Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
CHANGELOG.md | D | 12-May-2024 | 794 | 18 | 9 | |
LICENSE | D | 12-May-2024 | 748 | 16 | 12 | |
README.md | D | 12-May-2024 | 1.3 KiB | 46 | 33 | |
default-input.js | D | 12-May-2024 | 6.8 KiB | 245 | 218 | |
init-package-json.js | D | 12-May-2024 | 4.1 KiB | 155 | 115 | |
package.json | D | 12-May-2024 | 2.2 KiB | 86 | 85 |
README.md
1# init-package-json 2 3A node module to get your node module started. 4 5[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json) 6 7## Usage 8 9```javascript 10var init = require('init-package-json') 11var path = require('path') 12 13// a path to a promzard module. In the event that this file is 14// not found, one will be provided for you. 15var initFile = path.resolve(process.env.HOME, '.npm-init') 16 17// the dir where we're doin stuff. 18var dir = process.cwd() 19 20// extra stuff that gets put into the PromZard module's context. 21// In npm, this is the resolved config object. Exposed as 'config' 22// Optional. 23var configData = { some: 'extra stuff' } 24 25// Any existing stuff from the package.json file is also exposed in the 26// PromZard module as the `package` object. There will also be free 27// vars for: 28// * `filename` path to the package.json file 29// * `basename` the tip of the package dir 30// * `dirname` the parent of the package dir 31 32init(dir, initFile, configData, function (er, data) { 33 // the data's already been written to {dir}/package.json 34 // now you can do stuff with it 35}) 36``` 37 38Or from the command line: 39 40``` 41$ npm-init 42``` 43 44See [PromZard](https://github.com/npm/promzard) for details about 45what can go in the config file. 46