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

nin

v0.1.6

Published

Nodejs INstaller, the missing deploy tool for nodejs.

Downloads

1,462

Readme

nin

nin is Node INstaller, the missing nodejs app deploy tool.

nin tries to solve a trival-but-bother problem: how to deploy your nodejs app ?

ScreenShot

The manual method

When I manually deploy a nodejs app, I do

  1. Copy the project pkg and extract all files to deployment site dir.
  2. Change to that dir, npm install all my dependencies.
  3. After that, manually do some setup things, such as bash sth.sh or grunt.
  4. Finally start the app with node index.js or even forever index.js. (In this step I usually save my app's pid in some file for future.)
  5. And when there is a need, I stop the app with pid saved before.

So why not to make some tool to automate that process?

That is what nin do.

The nin method

Suppose you have your project in /path/to/yourapp or git://github.com/yourname/yourapp.git, with your nin.json conf file well prepared,

  1. mkdir yourapp_deploy; cd yourapp_deploy
  2. nin install /path/to/yourapp or nin install git://github.com/yourname/yourapp.git

Done. You app is installed and configured by nin.

Then you can nin start yourapp to start it or nin stop yourapp to stop it.

Installation

npm install -g nin

or locally

curl https://raw.githubusercontent.com/liyu1981/nin/master/install.sh | sh

Dependencies

  • nodejs >0.10.0
  • npm >1.4.0

Command Line Summary

  Usage: nin [options] [command]

  Commands:

    deploy <pkg>           Install your app.
      > <pkg> can be any llegal npm pkg names.
      > Ref https://www.npmjs.org/doc/cli/npm-install.html

    install <pkg>          Install your app.
      > This equals deploy then setup.
      > <pkg> can be any llegal npm pkg names.
      > Ref https://www.npmjs.org/doc/cli/npm-install.html

    remove [options] <pkgname> Remove your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/

    restart <pkgname>      restart your app.
      > This equals stop then start your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/

    setup <pkgname>        Setup your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/

    start <pkgname>        Start your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/
      > pid file will write to var/<pkgname>

    stop <pkgname>         Stop your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/

    update <pkgname>       Update your app.
      > <pkgname> is the pkg installed dir name, i.e., some name in <cwd>/apps/

    version [options]      Show version info.

  Options:

    -h, --help   output usage information
    -q, --quiet  turn on quiet mode

nin.json

nin.json is the configuration file of your app, which contains the intructions on how to setup/start/stop your app. It should be placed in the root dir (like package.json). The format is

{
  "setup": [
    { "type": "...", "content": "..." },
    ...
  ],
  "start": [
    { "type": "...", "content": "..." },
    ...
  ],
  "stop": [
    { "type": "...", "content": "..." },
    ...
  ]
}

setup

  • type can be bash|grunt
  • content is the relative path to your script/file.

start/stop

  • type can be bash|forever
  • content is the relative path to your script/file.

Project Example

Nothing can compared to an example. Check nin-example for different settings(in different git branch) of nin.