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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@maboiteaspam/npi

v2.0.3

Published

Node Project Init

Downloads

1

Readme

npi

Node Project Init. Way more than npm init -y.

Install

npm i @maboiteaspam/npi -g

Usage

npi

 Init a node project.

 Usage
   npi [module1 module2]
   npi [opts] -- [module1 module2]

   npi --explicit           Run explicit-deps
   npi --config             Show config
   npi --add [module]       Add workflow
   npi --default [module]   Set default workflow

 Options
   -v                       verbose
   -h                       show help
   -w                       Workflow to use
   --explicit               Invoke rvagg/node-explicit --yes.
   --add                    Add new init workflow.
   --default                Set the default workflow

 Examples
   npi debug minimist multiline
   npi -v -- debug minimist multiline
   npi -w @maboiteaspam/npi-regular -- debug minimist multiline

   npi --explicit
   npi -h

Workflow

Workflow is the stream that implement the initialization of the package.

Currently see npi-regular workflow.

Workflow are expected to create a minimal environment to get on work, cooked just for the user.

 - node_modules/
 - .gitignore
 - index.js
 - playground.js
 - package.json
 - README.md

Workflow must perform any action as automated as possible, otherwise query for user input at runtime.

Workflow describes your habits, preferences, environments requirements, when its about a node package setup.

Build your own

Please consider visiting

  • https://github.com/maboiteaspam/npi-regular
  • https://github.com/maboiteaspam/npi-utils

tips

Use -v to check the workflow errors while using npi.

npi -v -- mod1...

workflow signature

workflow are node module which exports a function(pkg, argv, conf), which must return a stream bubbler (one of stream-messenger, stream-router, bubbler, bubbled).

A simple workflow would be

    var messageRouter = require('stream-message-router')
    var npi = messageRouter('npi');

It is then possible to enhance the workflow in such way,

    var trimT         = require('@maboiteaspam/npi-utils/trim.js')
    var spawn         = require('@maboiteaspam/npi-utils/spawn')
    var bubble        = require('@maboiteaspam/npi-utils/bubble')

    npi
    .pipe(trimT(templateVars, ['author']))
    .pipe(spawn('npm', function (){
        return ['init', '--scope='+templateVars.author, '--yes']
    }))
    .pipe(bubble('message', {message: 'file', 'body':'package.json'}))

the latter, the workflow is connected to npi main stream, and invoked when necessary.

About the code

TLDR: It use a workflow stream npi on which transforms are piped to.

They execute in sequence, time management is totally left to the underlying pipe system.

To communicate with the user along the commands, npi will bubble events to the source stream.

msgListener a dedicated stream is setup to listen npi stream message events.

It then route chunks to specific transforms which are responsible to display an output given the type of message.

The type of events you may encounter are

When a file is created : {message: 'file', body:'path'}

When a process spawns : {message: 'spawn', body:child_process}

When a process has spawned (child_process.close event) : {message: 'spawned', body:child_process}

May this drawing you to jump in the code,

       process
-▶-stdin-▶|                       (1)
          | var npi = stream()    /
          |    .pipe() ▼         /
          |       route 'npi' -----▼
          |                        |
          |      (3)               |
          |      /                 |
          |  npi emit()◀--|        |
          |   ▼           |        |
          |  down         |        |
          |   ▼           ▲        |
          |   |    bubble()◀◀|     |-▶fnT1 (spawn npm)
          |   |              |           ▼ push()      (2)
          |   |              ▲           ▼            /
          |   |       bubble()◀◀|     fnT2 start bubble() ▶-|
          |   |                 |        ▼                  |
          |   |                 |        ▼  {type: 'file'   |
          |   |                 |------------body: 'index'}-|
          |   |                          ▼ push()
          |   |                       fnT3 (inquire)
          |   |                          ▼ push()
          |   |                       fnT4 (git commit)
          |   |                          ▼ push()
          |   |          (4)          (end of npi)
          |   |            \
          |   ▶-▶ var msgListener = eventStream('message', npi);
          |         .pipe() ▼
          |            route 'file' -▼
          |                          |-▶fnT1 (extract body)  (5)
          |                                 ▼ push()        /
          |                             fnT2 (log to console)
          |                                 ▼ push()
          |                             (end of msgListener)
          |     msgListener
          |         .pipe() ▼                            (5 bis)
          |            route 'spawn' -▼                 /
          |                           |-▶fnT1 (pipe to process)
          |                                 ▼ push()
          |                              (end of msgListener)
◀-stdout-◀|
   (end of process)

Read more

  • https://github.com/maboiteaspam/npi-regular
  • https://github.com/maboiteaspam/npi-utils
  • https://github.com/maboiteaspam/stream-messenger
  • https://github.com/maboiteaspam/stream-message-router
  • https://github.com/maboiteaspam/flower
  • https://github.com/maboiteaspam/bubbler
  • https://github.com/maboiteaspam/bubbled
  • https://github.com/maboiteaspam/event-stream-writer
  • https://github.com/maboiteaspam/set-verbosity
  • https://github.com/maboiteaspam/show-help