Node Flashcards
In Node, what is the package.json file?
It shows the project name, version, author, dependencies, a list of scripts, and more about the project
What is the “scripts” object in package.json?
A list of scripts that can be run with the syntax:
npm run script-name
What does the “proxy” property refer to in package.json?
It proxies api requests to start with a base URL
i.e. “proxy”: “http://localhost:5000”
What is the “concurrently” Node package used for in full stack development?
Running the client and server side code simultaneously
In Node, what does the –prefix flag do?
npm start –prefix name
Enables you to run a npm command against a different directory
(i.e. npm start –prefix client)
What is the syntax for the “concurrently” package to run both the client and the server commands from “scripts”?
“dev”: “concurrently "npm run client" "npm run server"”
In the scripts section of package.json, why would you add “client-install” script that uses npm install on the client directory?
To help install the client-side dependencies for when the project is cloned (i.e. from Git)
In a MERN application, where should bootstrap and reactstrap be installed?
In the client directory (all front-end code is in here)
How would you import ‘uuid’ into a MERN module?
import {v4 as uuid} from ‘uuid’;
What is does “process” (i.e. process.env) represent in Node?
The current process. One process is run per Node script. Therefore, this is a global object.
What is the syntax for printing the code that’s currently running in Node.js?
var fs = require(‘fs’);
fs.createReadStream(__filename).pipe(process.stdout)