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

develarms

v2.3.0

Published

Alternative devDependencies resolver that doesn't waste disk space

Downloads

5

Readme

DevelArms

Alternative devDependencies resolver that doesn't waste disk space

npm package

Q. What's this?

This is a CLI program to install/manage the development tools of your project, such as rollup, mocha, c8, jsdoc, or whatsoever.

Q. Why not just use devDependencies ?

The tools like listed above should be installed/used as global packages, because they are just commandline utilities. Assuming you are working on many projects that require these tools, it would be a huge waste of disk space if you install them as devDependencies of each project separately like this:

project1/
└── node_modules/
    ├── [email protected]
    └── [email protected]
project2/
└── node_modules/
    ├── [email protected] (duplicate)
    └── [email protected]
project3/
└── node_modules/
    ├── [email protected] (duplicate)
    └── [email protected]

DevelArms can solve this problem to like this:

node_modules/ (global)
├── [email protected]
├── [email protected]
└── [email protected]

project1/
project2/
project3/
└── node_modules/
    └── [email protected]

Installation

Local:

npm i --save-dev develarms

Global:

npm i -g develarms

Usage

Adding dependencies to your project

# example
develarms i rollup mocha

The above command installs rollup and mocha packages by internally executing:

npm i --no-save rollup mocha

Thanks to --no-save option, this command doesn't affect dependencies nor devDependencies in your package.json. Instead, the command adds develarms property, and stores the installed packages info as its properties like this:

// package.json
{
  "name": "my-project",
  ...
  "develarms": {
    "rollup": "^3.28.0",
    "mocha": "^10.2.0"
  }
}

Installing dependencies

develarms i

This command installs all the packages (let's say "dependencies") listed in develarms property in your package.json in the same manner as npm i command with dependencies/devDependencies properties.

The big difference from npm i command (and the sole purpose of this tool) is however, if you already have globally installed some of the dependencies on your machine, develarms i command skips installing them to save the storage space of your machine.

So, for example, if you have already installed recent version of rollup globally before, but have never installed mocha, and now run:

develarms i rollup mocha

Then, the command only installs mocha, skipping rollup which you already have on your machine.

By default, develarms i command installs packages locally. You can change this behavior by passing -g option to force it install globally:

develarms i -g

Other commands & options

develarms --help
Options:
  -V, --version                       output the version number
  -c, --config <file>                 config file (default: "package.json")
  -k, --config-key <key>              key of config object (default: "develarms")
  -n, --dry-run                       do not actually perform the operation
  -v, --verbose                       output detailed messages for debug
  -h, --help                          display help for command

Commands:
  list|ls [options]                   list dependencies
  install|i [options] [packages...]   install dependencies
  uninstall|rm <packages...>          uninstall dependencies
  upgrade|up [options] [packages...]  upgrade dependencies
  help [command]                      display help for command

Usage examples

Custom config key

If you prefer more semantic name than develarms for the property in package.json, it can be changed with --config-key or -k option, like this:

develarms i mocha -k globalDependencies

Resulting package.json:

{
  ...
  "globalDependencies": {
    "mocha": "^10.2.0"
  }
}

develarms © 2022 Satoshi Soma (https://github.com/amekusa)