K
K
Konstantin2019-04-05 00:18:09
Node.js
Konstantin, 2019-04-05 00:18:09

How to import a module from node_modules?

I want to build a custom index.js
Now the directory contains the following files and folders:
/node_modules
index.js
package-lock.json
How can I index.jsimport a module from in a file /node_modulesso that it can be used?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
piece of internet, 2019-04-05
@Junart1

var module = require('module-name');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question