Creates a new node project.
To quickly initate a project, with complete structure, for testing, developing and/or publishing node modules with or without a public or private git repository. Whew, that was a mouthful!
- reduce steps/boilerplate in module creation given sane preferences
- explore node further using process and assert
- a better understanding of callbacks.
- use a base argument processor and config it for application use (argh)
project name is now required else usage() is generated. see next entry for cavet
can enter npinit -d [options]
for a dry run without entering a project name.
flag -n/--new gone. use "test" as project name to replicate initing a new test project.
test name generated is now "test-###" instead of "testproj###"
flag --addRemote replaced with --remote
flag --noRemote replaced with --no-remote
flag --noPush removed. determined automatically
flag --dry can also use single flag -d
flag --D changed to --dep (install Dependencies)
flag --d changed to --dev (install devDependencies)
verbose option added (--verbose). displays standard output from git init
and npm install
using both options -rg or --repo --github generates a private repo only. private overrides public
if project name is "test" with option of --github then a private repo will only be generated. I am making the assumption that you will not call a public repo "test". You can over this by naming the project "test1" if you like.
$ npm install -g npinit
Update your npm config:
npm config set init.author.name "Your Name"
npm config set init.author.url "http://example.com"
npm config set init.author.email "[email protected]"
npm config set init.author.github "your-github-handle"
npm config set init.license "MIT"
npm config set init.version 0.1.0
Preview images available in the wiki.
# display help
npinit
npinit help
npinit -h
npinit --help
# display version
npinit -v
npinit --version
# dry run. will display metadata of configured options (private/local module)
npinit -d
npinit --dry
npinit test -d
npinit test --dry
npinit hello-world -d
# dry run. metadata of public or private module with git repo initialization.
npinit test -dg
npinit test -dr
npinit test -drg // this creates a private module with git repo. dry run though.
# project named hello-world with repo and pushed to github with
# command `hub created -d [description]`
# license and travis.yml files are created with github option.
npm hello-world -g
# project named test with repo private created
# If the name "test" is given a public repo will not be created.
# license and travis.yml files are created with github option.
npinit test -g
# project named test with repo and remote pushed to github using https
npinit test -g --remote
# essentially the same command. see next example for differences.
npinit test -g --no-remote
npinit test -r
# project named test with repo and no remote created.
# dependencies of async, lodash, coffeescript and mout installed.
# same as npinit test -r --dep "async lodash coffeescript mout" but
# license and travis.yml files are created.
npinit test -g --no-remote --dep "async lodash coffeescript mout "
# local module/repo, user added devDependencies
# test.js file created with installation of devDependencies
# stdout trace for npm install and git repo initialization with
# verbose option
npinit test -r --dev "tape istanbul " --verbose
# multi-line input.
# make things easier by creating a shell script with inputs
# to reduce typing.
npinit test \
--desc "Hello World " \
--author=me \
--email "[email protected] " \
--pkgv "0.4.0" \
--user=zeke \
--license "BSD " \
--dev "tape istanbul " \
--dep "async lodash coffeescript mout " \
--github \
--verbose
Not yet developed. Command-line app only.
initialize. Original inspiration of this project.
create-module. Another awesome project/module creation process which is extremely efficent.
ghrepo. Still another awesome project. Love the code organization and style.
ghwd. For the command line junkies like me.
hub. syntactic sugar for the git command.
argh. light weight option/argv parser for node, it only parses options, nothing more then that.