<commit_before>npm-mirror
==========

[![Build Status](https://travis-ci.org/mozilla-b2g/npm-mirror.png?branch=master)](https://travis-ci.org/mozilla-b2g/npm-mirror)

npm-mirror is a utility for mirroring a subset of npm packages from another npm registry. It syncs all of the dependencies for a particular node module and writes them to the local filesystem so that a simple webserver can behave like a commonjs compliant package registry.

## Notable Caveats

+ Your webserver must be configured to map root requests to index.json files.
+ Git repos will not be synced

## Getting Started

```
npm install -g npm-mirror
cd npm-mirror
npm install

DEBUG=npm-mirror:SyncManager bin/npm-mirror \
  --master http://registry.npmjs.org \
  --manifest /path/to/target/package.json \
  --hostname http://secret-npm-mirror.com \
  --root /where/we/put/packages/

// Start webserver rooted in packages directory
cd /path/to/target
npm install --registry http://secret-npm-mirror.com
```

### A Word About Arguments

#### master

a fully qualified url for the master registry's root

### manifest

a fully qualifed path to a manifest file (ie https://npmjs.org/doc/json.html)
<commit_msg>Clarify local vs global path in README<commit_after>npm-mirror
==========

[![Build Status](https://travis-ci.org/mozilla-b2g/npm-mirror.png?branch=master)](https://travis-ci.org/mozilla-b2g/npm-mirror)

npm-mirror is a utility for mirroring a subset of npm packages from another npm registry. It syncs all of the dependencies for a particular node module and writes them to the local filesystem so that a simple webserver can behave like a commonjs compliant package registry.

## Notable Caveats

+ Your webserver must be configured to map root requests to index.json files.
+ Git repos will not be synced

## Getting Started

```
npm install -g npm-mirror

DEBUG=npm-mirror:SyncManager npm-mirror \
  --master http://registry.npmjs.org \
  --manifest /path/to/target/package.json \
  --hostname http://secret-npm-mirror.com \
  --root /where/we/put/packages/

// Start webserver rooted in packages directory
cd /path/to/target
npm install --registry http://secret-npm-mirror.com
```

### A Word About Arguments

#### master

a fully qualified url for the master registry's root

### manifest

a fully qualifed path to a manifest file (ie https://npmjs.org/doc/json.html)

{'fraction_non_alphanumeric': 0.11389715257118573, 'fraction_numerical': 0.0016999575010624734, 'mean_word_length': 3.893970893970894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4240263', 'n_tokens_mistral': 761, 'n_tokens_neox': 704, 'n_words': 254}