Skip to main content

Posts

Showing posts with the label Node.js Test

Node.js Test Upwork Answers 2019

1. Which of the following will synchronously check if a file/directory exists? Answers: • fs.exists() • fs.existsSync() • fs.checkFileSync() • fs.checkDirSync() 2. Which of the following console commands will update all installed global packages to the latest available versions? Answers: • npm upgrade –g • npm install –uga • npm update –g • npm version —install-latest 3. What does process.argv[1] contain? Answers: • node • The file path of the JavaScript file. • The first command line argument. • The second command line argument. 4. Which of the following command-line arguments to «npm install» will allow an NPM package’s binaries to be run outside the project folder? Answers: • –g • –global • –l • –link 5. Which of the following can be used to access the environment variable, «ENV_VARIABLE» in Node.js? Answers: • process.env.ENV_VARIABLE • process.argv.ENV_VARIABLE • process.env.var.ENV_VARIABLE • process.environment.ENV_VARIABLE 6. W...