# npm-cache-install

> accelerate `npm install` by caching dependency

Latest version **0.1.1** (published 2016-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-cache-install
pnpm add npm-cache-install
yarn add npm-cache-install
bun add npm-cache-install
```

Provides the command `npm-cache-install`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-03-15 |
| First published | 2015-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | FallenMax@gmail.com |
| Maintainers | fallenmax |
| Keywords | npm, install, cache |

## Links

- npm: https://www.npmjs.com/package/npm-cache-install
- Repository: https://github.com/FallenMax/npm-cache-install
- Homepage: https://github.com/FallenMax/npm-cache-install#readme
- Issues: https://github.com/FallenMax/npm-cache-install/issues
- npm.io page: https://npm.io/package/npm-cache-install

## Dependencies (2)

- [semver](https://npm.io/package/semver.md) ^5.1.0
- [string-hash](https://npm.io/package/string-hash.md) 1.1.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-03-15
- 0.1.0 — 2016-03-15
- 0.0.1 — 2015-12-22

## README

# npm-cache-install

Offline `npm install`, using locally cached packages.

The idea is based on [npm-cache](https://github.com/swarajban/npm-cache), but instead of caching whole `node_modules` directory, `npm-cache-install` will cache each package seperately, so changing any of them will not invalidate whole cache.

Also, any npm options will be passed to `npm install` (like `--registry`, etc.)

## Usage:

### 1. npm-cache-install install [options]

Run it instead of `npm install [options]`, it will:

- read `package.json`, get a list of dependencies
- for each dependency
  + if already installed and satisfies specified version, continue
  + if cached in cache directory (`~/.npm-cache-install`), restore to `./node_modules/[dependency]`, continue
  + actually runs `npm install dependency@version [options]`,
  + save installed package to cache directory

### 2. npm-cache-install clean

`rm -rf` cache directory for you.


## Caveat:

1. Windows is not supported for now
2. Does not differentiate node version and node architecture (if node version changes, please clean cache directory manually)
3. Bad support for `peerDependency`, which might cause problems.
4. Not tested with npm@3

Issues and PRs are welcomed


## History

#### 2016-03-15 `0.1.0`

- add: 'clean' command
- fix: git/github/http(s) dependencies support
- fix: problem when handling intallation failure

---
_Source: https://npm.io/package/npm-cache-install · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
