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

indo

v0.6.8

Published

Workspaces where each package has its own commit history

Downloads

174

Readme

indo

Workspaces where each package has its own commit history.

Setup your monorepo with one command:

npx indo

Synopsis

Monorepos are great for keeping a bundle of packages tied together by a commit history, but sometimes a package needs (or already has) its own commit history. For example, you might be developing a fork of someone else's package. Indo lets you choose which packages deserve their own commit history. Just run git clone and Indo will notice. Note: Be sure to add your clones to .gitignore to avoid git submodules (which are not supported by Indo).

Indo automatically searches your monorepo for package.json files, which means it can be used with zero setup. The indo command will (1) create the .indo.json if none is found, (2) clone any missing repos, (3) install dependencies, (4) run build scripts, and (5) link local packages together.

Fun facts:

  • Indo never hoists dependencies
  • Indo plays nicely with Yarn workspaces
  • Indo makes forking a breeze

 

Guides

 

Commands

indo

Run this command to bootstrap your Indo-powered monorepo, which involves cloning any missing repos, installing any dependencies, and linking together your local packages.

Specify -f/--force to see which packages are linked where. Otherwise, only newly linked packages are printed.

Note: Packages are ignored when no version exists in their package.json.

 

indo help

Print documentation for a specific command.

# What does "indo clone" do?
indo clone help

Aliases: -h, --help

 

indo clone

Shallow clone a repository and add it to "repos" in the nearest .indo.json config.

You can even provide a package name instead of a git url! For example, indo clone lodash asks npm for the git url and clones it into vendor/lodash by default. You can also pass an optional directory name (eg: indo clone lodash a/b/c).

 

indo link

Link a global package to the ./vendor/ directory, and link it to packages that can use it.

indo link lodash

However, before you can do that, you must call indo link in your lodash clone.

# Clone "lodash" outside your monorepo.
git clone https://github.com/lodash/lodash.git ~/dev/lodash
cd ~/dev/lodash

# Add it to Indo's global package registry.
indo link

It's basically yarn link except with automatic linking to packages in your monorepo. 😻

For a monorepo whose root package is unnamed, use indo link -g <name> to register it globally. Then use indo link <name> to link your local packages to it.

 

indo unlink

Remove the current package from Indo's global package registry.

indo unlink

To revert indo link <name> commands, run indo unlink <name> and the given package names will be removed from the ./vendor/ directory (but only if they were added with indo link).

indo unlink lodash

 

indo add

Add dependencies to the current package, using its preferred npm client (eg: yarn or pnpm).

After installing, the dependency is replaced with a local package if possible.

indo add lodash

Supported flags:

  • --prod (enabled by default)
  • -P/--peer
  • -D/--dev
  • -O/--optional
  • -E/--exact

 

indo remove

Remove dependencies from the current package, using its preferred npm client.

indo remove lodash

Aliases: rm

 

indo list

See which packages are detected by Indo.

indo list

Aliases: ls

 

indo run

Run a npm script in every non-vendor package.

indo run build

 

indo exec

Run an arbitrary command in every non-vendor package.

Note: Piping is not yet supported.

indo exec -- echo \$PACKAGE_NAME

Injected variables include:

  • PACKAGE_NAME
  • PACKAGE_ROOT

 

indo git

Run a git command in every .git repo containing a non-vendor package.

Note: Your customized git aliases are supported!

indo git status

 

indo purge

Remove one or more packages, cleaning up .indo.json along the way.

For example, indo purge foo bar removes the ./foo and ./bar directories (relative to the current directory) from the filesystem and from the nearest .indo.json file.

The given directories are not required to contain a package.json. For example, you can do indo rm packages to delete the entire packages directory, which may contain dozens of repos, each with its own package.json. Indo re-installs the dependencies of any non-vendor package that was linked to a removed package.

It's basically rm -rf but with:

  • a confirmation prompt
  • automatic updates to the nearest .indo.json file
  • an install step for depending packages

 

indo init

Create an empty .indo.json file in the current directory, replacing any pre-existing .indo.json file.

The indo command automatically invokes this command when neither the current directory nor any of its ancestors contain a .indo.json file.