Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chakrit/npm-mirror
(Almost) all the stuff you need to start running an npm mirror locally on your machine.
https://github.com/chakrit/npm-mirror
Last synced: about 20 hours ago
JSON representation
(Almost) all the stuff you need to start running an npm mirror locally on your machine.
- Host: GitHub
- URL: https://github.com/chakrit/npm-mirror
- Owner: chakrit
- Created: 2012-12-06T16:24:07.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-06T16:42:42.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T12:21:33.427Z (7 months ago)
- Homepage:
- Size: 109 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NPM-MIRROR
(Almost) all the stuff you need to start running an npm mirror locally on your machine.
**DISCLAIMER**: I am just automating/packaging parts of the process described in this blog:
https://blog.caurea.org/2012/01/31/local-npm-registry-mirror.html# STEPS
* Install the tools. We're gonna need these (which hopefully you have already got them):
* node
* npm
* make
* couchdb---
* Clone the repository
```sh
$ git clone git://github.com/chakrit/npm-mirror.git path/you/want/for/mirror
$ cd path/you/want/for/mirror
```---
* Edits `Makefile` and change the variables to your liking.
```sh
$ cd path/you/want/for/mirror
$ nano Makefile
```Example of what's provided by default:
```make
ADMIN_USER = admin # local couchdb admin username
ADMIN_PASS = mirr0r # password
COUCH_HOST = 0.0.0.0 # where you are actually running the couchdb instance
COUCH_PORT = 1877 # couchdb portNPMORG_HOST = isaacs.iriscouch.com # source npm registry to clone from
NPMORG_PORT = 80 # port
```---
* Runs `make` to starts up a CouchDb instance.
```sh
$ cd path/you/want/for/mirror
$ make
# CouchDb should have been started running in your terminal window.
```---
* Runs `make setup` (in another terminal) to setup the CouchDb instance.
```sh
$ make setup
```---
* Runs `make replicate` to starts the replicating the configured npm registry to your machine.
```sh
$ make replicate
```This may take a really long time as the CouchDb database is being replicated over to your machine.
You might want to leave this running while you go work on something else.
---
* Gives `npm` the `--registry` flag pointing to your local CouchDb install whenever you want to install
or publish packages to/from this repository.```sh
$ npm --registry http://localhost:1877/registry/_design/app/_rewrite install yourpackage
```---
That's it!
# TODO
* Include CouchDb pre-built?