open-index/open-npm huggingface dataset:
npm package: @goldenbrick/install-subset
Description: Install a subset of npm dependencies based on given contexts
Author: fabrice@kfdevelopment.com
Latest version: 1.0.0

<p align="center">
  <img src="https://raw.githubusercontent.com/tabrindle/install-subset/master/logo.png" align="center"  width="700px"/>
  <h3 align="center">Stop installing npm devDependencies that you don't need.</h3>
  <hr/>
</p>

[![npm version](https://badge.fury.io/js/install-subset.svg)](https://badge.fury.io/js/install-subset)
[![npm downloads per month](https://img.shields.io/npm/dm/install-subset.svg?maxAge=86400)](https://www.npmjs.com/package/install-subset)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/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](http://devhumor.com/content/uploads/images/August2017/node-modules.jpg)
- 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](https://github.com/bentonam/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](https://github.com/bentonam/fakeit)
```
rm -rf node_modules && subset install "development"
...
real    0m11.157s
user    0m9.261s
sys     0m6.134s
```
npm package: @goldenbrick/package-build-order
Description: Determines the dependency order in which to build npm packages.
Author: Josh Goldberg
Latest version: 0.2.5

# package-build-order
[![Build Status](https://travis-ci.org/JoshuaKGoldberg/package-build-order.svg?branch=master)](https://travis-ci.org/joshuakgoldberg/package-build-order)
[![NPM version](https://badge.fury.io/js/package-build-order.svg)](http://badge.fury.io/js/package-build-order)

Determines the dependency order in which to build packages.

### Usage

* Use `buildOrder` to get a single `string[]` of builds in series.
* Use `getBuildTracker` to get a tracker that tracks which packages become available to build when others complete.

#### `buildOrder`

`buildOrder` takes in settings object providing an `Object` or `Map` member named `paths` linking package names to their folder or `package.json` paths.
It returns a `Promise` for the order in which the packages should be built.

For example, if `second` has a dependency on `first` in its `package.json`, the order would be `["first", "second"]`.

```javascript
import { buildOrder } from "package-build-order";
```

Passing a traditional `Object`:
```javascript
const order = await buildOrder({
    paths: {
        first: "./path/to/first",
        second: "./path/to/second"
    }
});
```

Passing a `Map`:
```javascript
const order = await buildOrder({
    paths: new Map([
        ["first", "./path/to/first"],
        ["second", "./path/to/second"]
    ]
}))
```

#### `getBuildTracker`

`buildOrder` takes in settings object providing an `Object` or `Map` member named `paths` linking package names to their folder or `package.json` paths.
It returns a `Promise` for a tracker object with two methods:

* `getAvailablePackages` - Returns a `string[]` with all packages that are able to build.
* `markCompleted` - Marks a package as completed and returns a `string[]` of any packages that are now available to build.

If `markCompleted` returns an empty `[]`, that indicates all possible packages have been completed.

```javascript
import { getBuildTracker } from "package-build-order";

const tracker = await getBuildTracker({
    paths: {
        first: "./path/to/first", // dependencies: []
        second: "./path/to/second" // dependencies: ["first"]
    }
});

tracker.getAvailablePackages(); // ["first"]
tracker.markCompleted("first"); // ["second"]
tracker.getAvailablePackages(); // ["first", "second"]
```

### Settings

You can also pass direct references to `.json` files, provided they provide `"dependencies"` as an array of project names.

```javascript
const order = await buildOrder({
    paths: {
        first: "./path/to/first/package.json",
        second: "./path/to/second/custom-settings.json"
    }
});
```

*Requires Node >= 7*