Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
script building package.json files, like `npm init`
JavaScript
branch: master
Failed to load latest commit information.
bin usage info
example fix if the license file already exists
README.markdown -g since it's a command
index.js keep streams in compatibility mode
package.json update editor

README.markdown

pkginit

Script building package.json files, like npm init.

example

Create a default.json using prompter syntax to serve as the basis for whenever you type pkginit:

{
  "name": basename.replace(/^node-/, ''),
  "description": prompt(),
  "version": "0.0.0",
  "repository": {
    "url": "git://github.com/substack/" + basename + ".git"
  },
  "main": prompt('entry point', 'index.js'),
  "scripts": {
    "test": "tap test/*.js"
  },
  "dependencies": {},
  "devDependencies": {
    "tap": "~0.2.5"
  }
}

Then add this file as the default:

$ pkginit add default default.json

Now when you type pkginit, you will only be prompted for the entries you've scripted:

$ mkdir beep-boop; cd beep-boop
$ pkginit
description: make beep and boop sounds
entry point: (index.js)

variables

In packages, these variables are availble:

  • basename - shorthand for path.basename(process.cwd())
  • process - node's process
  • require - node's require, rebased to process.cwd()
  • env - shorthand for process.env

install

With npm do:

npm install -g pkginit

license

MIT

Something went wrong with that request. Please try again.