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

monop

v3.0.6

Published

A npm-scripts hook for lazy development of dizzying monorepo applications.

Downloads

2

Readme

monop

build status npm version

Monop is a npm-scripts hook for lazy development of dizzying monorepo applications.

Installation

$ npm install -g monop

Usage

Monop is CLI tool for monorepo applications like below.

some-project/
├── monop-workspace.json
├── package.json
└── packages
    ├── pkg-1
    │   ├── index.js
    │   └── package.json
    ├── pkg-2
    │   ├── index.js
    │   └── package.json
    └── pkg-3
        ├── index.js
        └── package.json

This project has package.jon in the project root, and workspaces under packages/ directory. Each workspace has package.json too.

The project needs monop-workspace.json, Monop configuration file, to be managed by Monop. Monop sees the directory where it is as the project root.

Syntax of monop-workspace.json

Example:

{
  "workspaces": ["packages/*/package.json"]
}

.workspaces

Set array of glob pattern strings. Monop search workspaces with the patterns. The pattern must be ends with package.json. Monop will ignore node_modules by default.

.commonLocalDependencies

Set array of workspacce package names. They will be common localDependencies.

Monop commands

Monop provides monop command.

monop link

Creates symbolic links of all locaDependencies under node_modules in each workspace. This enables each workspace to use others.

$ monop link [options] <workspace_query>

Example:

$ monop link all
[monop] Create symlinks in @project01/pkg-2
[monop] Symlink: packages/pkg-2 -> packages/pkg-2/node_modules/@project01/pkg-1

[monop] Create symlinks in @project01/pkg-3
[monop] Symlink: packages/pkg-3 -> packages/pkg-3/node_modules/@project01/pkg-2

In this case, @project01/pkg-1 depends on @project01/pkg-2, and @project01/pkg-2 depends on @project01/pkg-3.

monop list

Shows all workspaces.

monop exec

Executes a command in workspaces.

$ monop exec [options] <workspace_query> <command...>

Example:

$ monop exec pkg-3 npm install

npm install will be run in packages/pkg-3. You can run this command in everywhere directory under the project root.

Workspace Query

Workspace query string can be:

  • Workspace name (the pachage name package.json)
  • Workspace short name (You can see by monop list)
  • Workspace directory relative path (For example, .)
  • You can spacify all workspaces with all

You can use the option --chain. The word "chain" means all local dependencies of the workspace searched recursively. With the option --chain, the command run in all "chain" workspaces.

Examples:

# Exec "npm run prepare" in all workspaces
$ monop exec all npm run prepare
# Exec "npm install" in all chain workspaces of pkg-3
$ monop exec --chain pkg-3 npm install
# Exec "npm install" in all chain workspaces of current directory workspace
$ monop exec --chain . npm install

About "localDependencies"

The command monop exec --chain requires custom field .monop.localDependencies in package.json in each workspace to specify local package dependencies.

Example:

{
  "monop": {
    "localDependencies": [
      "@project01/pkg-2"
    ]
  }
}

Example projects

See test/fixtures.