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

install-perfection

v0.1.3

Published

Install dependencies with control 💖

Downloads

10

Readme

Install Perfection

Typed with TypeScript npm version ci Github

Install dependencies with control 💪

Sometimes, you need nuance and control over your npm dependencies.

You might want to minimize your node_module folder size when shipping to production. Or, you might want to switch dependencies on the fly. For this, Install Perfection might be the tool you need.


How easy is Install Perfection to set up?

Very easy!

If not, submit an issue!

You can use Install Perfection as a CLI only.

npx install-perfection --include {"playwright-core": "latest"} --ignore {"playwright": "latest"}

If you'd like to use it a bit more explicitly, you can configure it in your package.json.

// package.json
{
  ...
  "install": {
    // include this dependency
    "include": {
      "playwright-core": "latest"
    },
    // but don't include this one!
    "ignore": {
      "playwright": "latest"
    }
  }
  ...
}

Or, if you like to keep your package.json pure, you can create a .installrc file with the same configuration.

// .installrc
{
  "include": {
    "playwright-core": "latest"
  },
  "ignore": {
    "playwright": "latest"
  }
}

If you'd like to build something custom, you can copy it's functionality into your own project or you can use the exported functions directly—as they're typed and tested.

import { install } from 'install-perfection'

install({
  include: {
    'playwright-core': 'latest'
  },
  ignore: {
    'playwright': 'latest'
  },
})

How do I use Install Perfection?

Install Perfection is built to be used as a CLI first and foremost. It also exports node functions which can be used to preform the same install operation.


Install or reference Install Perfection in your project.

npm install install-perfection --save-dev

CLI API

Listed below are the CLI options and arguments to execute install-perfection. To *view all cli options, run install-perfection --help!

Usage: install-perfection [options]

Install dependencies with control, perfectly 💪

Options:
  -V, --version               output the version number
  -c, --config <config>       config path
  --debug                     enables debug mode
  -d, --dest <string>         dest path
  -f, --file <file>           path to package.json file
  --has-lockfile              use lock file
  -p, --path <path>           path to package.json file
  -r, --runner <runner>       npm, pnpm, or yarn (bun support coming; use npm for bun now)
  -i, --include [include...]  include dependencies, include an array of json parseable string
                              wrapped objects, e.g. `--include '{"foo": "bar"}' '{"biz": "baz"}'
                              `
  --ignore [exclude...]       exclude dependencies, e.g. `--exclude foo bar`
  -h, --help                  display help for command

Recipes

Install an additional list of dependencies.

install-perfection --include {"playwright-core": "latest"}' '{"react": "latest"}

Ignore an array of dependencies.

install-perfection --ignore playwright react

Ignore and install dependencies for Install Perfection.

install-perfection --ignore playwright react --include {"playwright-core": "latest"} {"react": "latest"}

Install while including a lock file.

install-perfection --has-lockfile --ignore playwright

Add a custom path to the package.json file you're installing perfection for.

install-perfection --path ./path/to/package.json --ignore playwright

Add a custom path to install your node_modules.

install-perfection --dest ./path/to/node_modules_dest --ignore playwright

Use a custom runner (dependence manager)

install-perfection --runner pnpm --ignore playwright

Make it fast by inputting your config to your command.

install-perfection --config ./path/to/.installrc --ignore playwright

Get debugging information.

install-perfection --debug --ignore playwright

Node API

The node API works exactly the same as the CLI API.

import { install } from 'install-perfection'

install({
  include: {
    'playwright-core': 'latest'
  },
  ignore: {
    'playwright': 'latest'
  },
})

Is the name, "Install Perfection", a bit much?

Yes. Just like your node_module folder. 😜 Use Install Perfection to make your node_modules a bit less.


Made by @yowainwright, MIT 2023