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

hyperinstall

v1.3.0

Published

Runs "npm install" in several directories and remembers their state across hyperinstalls

Downloads

62

Readme

Hyperinstall

npm package

Hyperinstall is a program that runs yarn or npm install in multiple directories. Most companies have several npm packages in a project. Whenever you update your local copy of the code, you need to run npm install in case any of these packages has different dependencies since the last time you ran npm install. Hyperinstall automates and accelerates this with one command.

Hyperinstall automatically runs yarn and npm install

$ ./npm-hyperinstall
Package "a" has been updated; installing...
...
Finished installing "a"

Package "b" has been updated; installing...
...
Finished installing "b"

Updated 2 packages:
  a
  b

Hyperinstall is efficient when your dependencies haven't changed

$ time ./npm-hyperinstall

real  0m0.232s
user  0m0.206s
sys   0m0.032s

Installation

The only prerequisite is Node.js 4.0 or newer. The best way to install Node.js is with nvm.

  1. Install Hyperinstall globally: npm install -g hyperinstall. Now the hyperinstall command is in your path. Everyone on your team must do this.
  2. Run hyperinstall init in the root directory of your project, or wherever your project scripts are stored. Make sure this is a directory that is under version control and is shared with your teammates. Hyperinstall creates two files: hyperinstall.json and npm-hyperinstall.
  3. hyperinstall.json is a configuration file containing a JSON object.
  • The keys of the object are paths to npm packages in which you want Hyperinstall to run npm install. Both absolute and relative paths are supported; relative paths are resolved relative to hyperinstall.json.

  • The values of the object are cache breakers. Start with 0 and bump it to 1, 2, 3, etc. if you need to force Hyperinstall to run npm install in the respective package. This usually isn't necessary since Hyperinstall tracks whether each package's dependencies have changed since the last time it ran, but the cache breakers serve as an escape hatch if necessary.

  • For example, if your repository were to look like this:

    .
    ├── hyperinstall.json
    ├── npm-hyperinstall
    ├── server
    │   ├── index.js
    │   ├── node_modules
    │   └── package.json
    └── website
       ├── index.js
       ├── node_modules
       └── package.json

    Then to run npm install in your server and website packages, hyperinstall.json should look like this:

    {
      "server": 0,
      "website": 0
    }
  1. npm-hyperinstall is a script that runs yarn or npm install in each of your npm packages and can be run from anywhere. It is a shortcut for cd your/project/root && hyperinstall install.
  2. Add /.hyperinstall-state.json to your .gitignore file. This file is created by npm-hyperinstall and records the dependencies that are installed in each npm package.
  3. After testing Hyperinstall (see the Usage section), commit hyperinstall.json, npm-hyperinstall, and .gitignore to your repository.

Usage

Run npm-hyperinstall. It will run yarn or npm install in each of your npm packages and create a file called .hyperinstall-state.json that records the dependencies that were installed.

The next time you run npm-hyperinstall, it will check if any of the packages' dependencies have changed since the last time you ran Hyperinstall. It will run npm install in each package with different dependencies. When the dependencies haven't changed at all, Hyperinstall is very fast and exits quickly.

Options

To locally force Hyperinstall to reinstall all of your npm packages, run it with -f (short for --force). Hyperinstall will first delete each package's node_modules directory before running npm install in each one.

Contributions

Contributions are welcome. We're most interested in improving the workflow so feedback in that vein is especially interesting to us. Also bug fixes are appreciated. We might be more selective with diffs that add a fair bit of complexity since we generally want Hyperinstall to be a simple script on top of yarn and npm install.