Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any documentation on the package.json file?

Here's an instance of the package.json file that express.js generates

{     "name": "packagename",     "version": "0.0.1",     "private": true,     "dependencies": {         "express": "2.5.5",         "stylus": "0.22.2"     } } 

It's fairly obvious that I can add packages to the dependencies object. However I have no idea what "private": true means. Nor do I know what syntax I can use in the dependencies value fields. I've Googled for quite a while without discovering anything.

What I'm wondering is pretty much if a complete summary of all settings that the package.json file can contain exists, as I could not find one. I haven't checked man since I'm on a windows PC.

Thanks

like image 654
Hubro Avatar asked Jan 09 '12 06:01

Hubro


People also ask

What does package JSON file contain?

Your package. json holds important information about the project. It contains human-readable metadata about the project (like the project name and description) as well as functional metadata like the package version number and a list of dependencies required by the application.

What is the purpose of the package JSON file?

A package. json is a JSON file that exists at the root of a Javascript/Node project. It holds metadata relevant to the project and it is used for managing the project's dependencies, scripts, version and a whole lot more.

What creates the package JSON file?

The easiest way to create a package. json file is to run npm init to generate one for you. It will ask you to fill out some fields, and then create a package. json file in the current directory.

Can I edit package json?

json is an auto-generated Node. js NPM package file for your project. You cannot directly edit this file from within Autocode. Autocode will automatically parse your entire project for NPM dependencies and add them automatically.


2 Answers

You're looking for the output of npm help json. It is available in Markdown format on NPM's GitHub project.

Also check out this interactive guide:

SShot

like image 54
Michelle Tilley Avatar answered Oct 13 '22 21:10

Michelle Tilley


Besides the official guide for package.json from NPM, the guys from Nodejitsu made a nice cheatsheet for it: http://package.json.nodejitsu.com/

like image 33
alessioalex Avatar answered Oct 13 '22 21:10

alessioalex