Ad Code

Ticker

6/recent/ticker-posts

how to create nodejs package.json file

Create package.json file for NodeJS projects

how to create nodejs package.json file


The NodeJS project is use a configuration file name is package.json and this file includes configuration and description about the project with dependent files. The NodeJS package.json file structure sample is below type:-

{
  "name": "myapp",
  "version": "1.0.0",
  "description": "This is myapp",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
  },
  "author": "priyadigitech",
  "license": "MIT",
  "dependencies": {
    "jquery": "1.3.0",
  }
}
If you copy this and change details according to your project such that name, script, description etc. then it works perfectly but if your project use some library for the project requirement then you can add in dependencies with the proper structure like "dependency_name":"0.1.2".

    You can create another way in new projects or existing projects by using npm init command in cmd after setting the project directory path.

Post a Comment

0 Comments

Ad Code