-
-
Save iJKTen/8b178a3f447f2fce88151c542396a777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To create a new project with prompts | |
> npm init | |
To create a new project without prompts | |
> npm init -y | |
Install a package (will be used in production) | |
> npm install <package-name> | |
Installing a dev package | |
> npm install —save-dev nodemon | |
> npm i —D nodemon | |
Run npm script | |
In package.json under scripts, create a new dev entry to run nodemon <filename> | |
Command to run that script | |
> npm run dev | |
List outdated packages in your app | |
> npm outdated | |
List outdated globally | |
> npm outdated -g | |
Update package globally | |
> npm install <package-name>@latest -g | |
Uninstall package | |
> npm uninstall <package-name> | |
Uninstall packages globally | |
> npm uninstall -g <package-name> | |
Environment Variables | |
Access environment variables | |
> process.env.NODE_ENV | |
Environment variable to set node environment | |
> NODE_ENV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment