The package.json file. The package.json file is really just a metadata file that is required for all npm packages or Node.js projects. It's located in the root directory of a project or a package, and if you plan to share or publish your package, to the npm registry, you must have this file in it. Now, this is a single JavaScript file, has all the data and has a JSON notation. All this information are usually split into two types of metadata, called the identifier and the functional. The identifier metadata are usually things that describe your project. For example, the name of the project, the version number, the author, the date, and so on. The functional metadata provides instructions for npm to process the project. Things like a script that tells npm how to start the program, where to start the program, which script to run, or what type of dependencies, packages to install and so forth. Now, this file has a lot of those fields in there, but two most important fields that are required are the name and version. The npm packages, the packages that JSON file is not complete without these two fields. Let's go take a look and see what this file really looks like in npm and Node.js application.
コメント