npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npinit

v0.7.2

Published

node project init: basic unix style module creation, opinionated defaults

Downloads

10

Readme

npinit

NPM version build status Test coverage Downloads experimental


Creates a new node project.
!! Breaking change. Options re-configured.

Goal

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!

Why?

  • to reduce steps/boilerplate in module creation given my preferences
  • to explore node further (process, assert)
  • to get better understanding of callbacks.
  • to use a base argument processor and config it for application use (argh)

Installation

$ 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

Usage

  Usage: npinit <packageName> [options]
         npinit <packageName> -dry [options]
         npinit -n [options]
         npinit -dry [options]

  Options:

    -h, --help          output usage information

    -v, --version       output the version number

    --dry               dry run displaying metadata used for generation

    -n, --new           new private module. for use without a packageName. the default
                        packageName `testproj###` will be assigned. random number `###`
                        generated to avoid potential conflicts.

    -g, --github        new public module. a git repository will be
                        automactically initialized and pushed to gihub. a packageName
                        is required. [default mode is private module, no git repo]
                        running option -n or --new with -g or --github is equivalent to
                        option `-nr` or `--new --repo` initializing a new private
                        module with a git repository. packageName will not be required.
                        options --addRemote, --noRemote and --noPush are inactive in
                        this mode when `-ng` are run together.

    -r, --repo          initialize a git repository when generating a private module
                        [default is none]

    --addRemote         process will use the generic git command:

                          `git remote add origin https://github.com/username/repo.git`

                        username and repo will be automactically added. Leaving this
                        option off will use `hub` (https://github.com/github/hub)
                        to createthe remote repository. [default command `hub create`].
                        You will have to enter your github username and password
                        if NOT using the --noPush option.

    -R, --noRemote      do not create a remote repository on github. noRemote
                        assumes noPush and will override addRemote if both are present.
                        it will also override the default remote command `hub create`
                        if addRemote is not present when creating a public module
                        with flags -g or --github.

    -P, --noPush        do not push repository to github. use only with
                        flags -g or --github [default is push]

    --D <string>        a list of node modules to install, i.e.,
                        `--D "lodash moment"` or `--D "lodash, moment"`.
                        [npm i --save packages]

    --d <string>        a list of node dev modules to install, i.e.,
                        `--d "tape istanbul"` or `--d "tape, istanbul"`.
                        [npm i --save-dev devpackages]

  Overrides:

    --desc    <string>  description for package.json and github repository if using `hub`.
    --author  <string>  author name for project. [default reads from .npmrc or 'Your Name']
    --email   <string>  email for project. [default reads from .npmrc or '[email protected]']
    --user    <string>  github username [default reads from .npmrc or 'githubName']
    --license <string>  license type for project. [default reads from .npmrc => ISC]
    --pkgv    <string>  semantic version for project [default reads from .npmrc => 1.0.0]

Examples

npinit --dry # same as npinit -n --dry
# dry run. will display metadata of configured options (private/local module)  

npinit -g --dry
# dry run. metadata of public module with git repo initialize  

npinit -ng --dry
# dry run private/local module with git repo initalized  

npinit -g --noPush
# display help because -g/--github wants a package/project name  

npinit test -g  
# project named test with repo and pushed to github with command `hub created -d [description]`  

npinit test -g --addRemote --noPush
# project named test with repo and remote created to github with https but not pushing to github   

npinit test -g --noRemote --D "async lodash coffeescript mout " 
# project named test with repo and no remote created. 
# dependencies of async, lodash, coffeescript and mout installed. 
# same as npinit test -r --D "async lodash coffeescript mout"

npinit test -g --desc "Hello World" --author=me --email "[email protected]" --pkgv "0.4.0" --user=zeke --license "BSD"
# project named test with repo pushed to github with hub create and user overrides  

npinit hellotest -r --d "tape istanbul"
# local module/repo, user added devDependencies  

See Also

initialize. Inspiration of this project. This is my fork, albeit a bloated fork.
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.

License ISC license

ISC