Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaddyp/node_api
https://github.com/kaddyp/node_api
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kaddyp/node_api
- Owner: Kaddyp
- Created: 2024-08-03T18:52:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-04T10:02:11.000Z (3 months ago)
- Last Synced: 2024-08-05T11:03:29.736Z (3 months ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md.txt
Awesome Lists containing this project
README
# https://github.com/Kaddyp/node_api
1. pm2 ==> https://pm2.keymetrics.io/
2. Run the npm shrinkwrap command ==> It will lock all dependencies versions within the file npm-shrinkwrap.json giving you control over
the dependencies versions of your project. This command is very useful in a production environment, where the versions need to be stricter.3. "scripts": {
"start": "node app.js",
"clean": "rm -rf node_modules",
"test": "node test.js"
}
The npm run clean command is an example of a global command from the bash, which internally runs the command rm -rfnode_modules to delete all files from the node_modules folder.4. ORM library that aligns with your project requirements (e.g., Sequelize, TypeORM, Prisma)
5. Why to install babel ==> The current Node.js version does not support ES6 perfectly, but we can use a module that emulates some of the resources from ES6/ES7 to make our codes better. To do this, we are going to install babel, a JavaScript compiler responsible for converting ES6/ES7 codes to an ES5 code only when the JavaScript runtime doesn’t recognize some ES6/ES7 features.
To use all features from ES6/ES7, we are going to install the babel-cli and babelpreset-es2015 modules in the project, running this command:
## npm install [email protected] [email protected] --saveNow you need to link the preset babel-preset-es2015 to be recognized by the babel-cli. To do this, just create the file .babelrc with this simple code:
{
"presets": ["es2015"]
}Update pakage.json and run command ==> npm start
"scripts": {
"start": "babel-node index.js"
},