requesting all main node_modules files

Asked

Viewed 104 times

0

I have installed some dependencies with the NPM, these dependencies are basic, like bootstrap, animatecss and others...

Anyway, I would like to know how I do to call these dependencies in a simple way. because I am using this type of call:

import 'node_modules/chosen-js/chosen.jquery.js';
import 'node_modules/hammerjs/hammer.min.js';
import 'node_modules/hammerjs/hammer.min.js';

and in the css folder:

@import '../node_modules/css/font-awesome.min.css';
@import '../node_modules/dist/css/materialize.min.css';
@import '../node_modules/dist/css/materialize.min.css';
@import '../node_modules/slick/slick.css';

I saw something about require and tals, but I didn’t really understand how it works.

1 answer

0


root@sdv 7 [~/Node/node_modules/live_webcam]# npm install body-parser --save

All installed modules are within node_modules so to call is as below:

In your Node APP file :

    const   bodyParser  = require('body-parser');

The variable bodyParser now contains the module methods. I use it so I am new in Node but I think it is correct!

Hugs

Browser other questions tagged

You are not signed in. Login or sign up in order to post.