Tuesday, April 24, 2018

How to install a module package and use it

1- Install lodash module package in the console:

npm install lodash

2- Create a file called demo.js
3- Add the following code:

var _ = require('lodash')

console.log(_.random(1,10))

4- Save changes

5- Execute in console:

node .\demo.js

6- Console output will be a random number each time you execute .a

No comments:

Post a Comment