Coder Social home page Coder Social logo

install-subset's Introduction

Stop installing npm devDependencies that you don't need.


npm version npm downloads per month License: MIT

You can exclude some npm devDependencies with install-subset when you don't need them.

Consider:

  • A CI server for your builds: you may not need your linting or testing tools. With a busy or shared server, you can save precious time.
  • A data generation library you only need once.
  • Toolsets that only a certain team member needs or uses, depending on their job, IDE or preferences.

Even with npm 5 and yarn, installing node modules can be a long and painful task. Sometimes you have to build a native bindings like node-sass or couchbase, and sometimes you just have 100,000 dependencies. You are at the mercy of:

  • your connection speed & latency
  • your computer's willingness to cooperate
  • the number of dependencies
  • the disk space available
  • your patience

Installation

npm install -g install-subset

Usage

Add something like to your package.json:

"subsets": {
  "build": {
    "include": [
      "babel-cli",
      "dotenv",
      "webpack"
    ]
  },
  "test": {
    "exclude": [
      "eslint",
      "prettier"
    ]
  }
}

In your terminal: $ subset install test

This installs your normal dependencies, minus eslint and prettier.

Case Study

fakeit is an amazing fake data generation library with support for couchbase, complicated related data models, multiple export options and more. However, its dependency tree is large, and has a dependency on a native Couchbase binary. In an example React Native project, just excluding this one rarely used devDependency cuts install time by around 29 seconds.

Warm cache, yarn v1.5.1, fresh install, without install-subset

rm -rf node_modules && yarn
...
real    0m40.496s
user    0m32.451s
sys     0m11.309s

Warm cache, yarn v1.5.1, fresh install With install-subset excluding fakeit

rm -rf node_modules && subset install "development"
...
real    0m11.157s
user    0m9.261s
sys     0m6.134s

install-subset's People

Contributors

tabrindle avatar justinrainwater avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.