Changes

Jump to: navigation, search

DPS909 & OSD600 Winter 2017 - Lab 2

975 bytes added, 13:55, 13 January 2017
2. Understanding package.json
Node uses a special file named <code>package.json</code> to specify metadata about a module. You can read a complete description of <code>package.json</code> at https://docs.npmjs.com/files/package.json.
A <code>package.json</code> file has to be valid JSON, and [https://docs.npmjs.com/getting-started/using-a-package.json#requirements must include a few fields]. However, many of the fields are optional. Let's look at some examples from popular node.js open source projects:
* https://github.com/foreverjs/forever/blob/master/package.json
* https://github.com/expressjs/express/blob/master/package.json
The metadata in <code>package.json</code> is used by the command-line tool <code>npm</code> as well as by the online registry https://www.npmjs.com/. Providing good data for these tools makes it easier for developers to find and use node modules.
 
==3. Contributing fixes to package.json files==
 
For our first contribution to an open source project, we're going to go looking for ways we can help existing node.js based projects do a better job with their <code>package.json</code> files. This could involve a number of things:
* correcting errors generated by http://package-json-validator.com/ for a <code>package.json</code> file
* adding missing optional fields to a <code>package.json</code> file
 
[https://www.google.ca/search?hl=en&as_q=&as_epq=inurl%3Apackage+json&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=github.com&as_occt=any&safe=images&as_filetype=pdf&as_rights=#hl=en&as_qdr=all&q=%22inurl:package.json%22+site:github.com+filetype:json list of package.json files on github.com]
 
...

Navigation menu