NPM Hands-on Fresco Play


1. Creating your First NPM package
Create the file package.json using npm commands.
Make use of the following information:
The name of the app should be npm_package.
The start point will be index.js
The project should have the following elements of
dependencies
- Install the latest version of react
- Lodash with major version 4 and minor version 17
- Redux with Major version 4
- Mocha for testing in Dev
- Eslint with major version 6 in Dev

npm init
npm_package
// comment (after this press enter multiple times till the line "is it ok?(yes)"
give yes and press enter)
npm install react
npm install lodash@4.17.0 --save
npm install redux@4 --save
npm install --save-dev mocha
npm install eslint@6 --save-dev
//comment (run the test)


2.NPM commands to execute scripts
Perform the below-mentioned steps by creating package.json file
named npm_commands.
1. Create a file named index.js.
2. Write a js code in Index.js file to create a string named myVar and value as node package manager and convert it into uppercase. 
NOTE: Please use console.log to display the output of myVar in
index.js file
2. Configure scripts in package.json
(a) to check the versions of npm and node by using npm run
release tee output1.txt
(b) to execute index.js by using npm run build | tee output.txt

npm init

npm_commands

//comment(after this press enter multiple times till the line "is it ok?(yes)"

give yes and press enter)

vi index.js

//comment (you are inside index.js press (i) and enter the commands

 [var myVar="node package manager".toUpperCase();

 console.log(myVar);]

 after entering the above commands press esc ,then (:),then (wq) and give enter)

vi package.json

//comment (then press (i) and go to tests line press enter and give ',' at end

of the test line and give commands

["release":"npm -v && node -v",

 "build":"node index.js"]

after entering the above commands press esc ,then (:),then (wq) and give enter)

npm run release|tee output1.txt

npm run build|tee output.txt



Disclaimer: This site is for purely educational purposes only. we recommend it only for reference. we still encourage you to go through the course and learn the topics