When is the package-lock.json file created or updated in a Node.js project?
- It is created when the project is started and never updated
- It is created when dependencies are installed or updated using npm
- It is automatically created when the project is pushed to a version control system
- It is manually created by the developer when needed
The package-lock.json file is created or updated in a Node.js project when dependencies are installed or updated using npm (Node Package Manager). This file keeps track of the specific versions of dependencies currently used in the project. It is automatically generated and updated to reflect changes in the project's dependencies. The other options are not accurate; it's not created when the project is started, it's not automatically created when pushed to version control, and it's not manually created by developers for typical use cases.
Loading...
Related Quiz
- You are building a chat application and need to implement a feature to upload and download files. How would you use streams in Node.js to handle file transfers efficiently between the client and the server?
- In a distributed NoSQL database, the ______ strategy can be used to resolve conflicts between different versions of the same document.
- Which of the following is true regarding object keys in JavaScript?
- What is the difference between process.nextTick() and setImmediate() in Node.js?
- You are tasked with creating a user dashboard using EJS where user-specific data needs to be displayed. How would you securely pass user data from the server to the EJS template and ensure that it is correctly escaped to prevent XSS attacks?