morose
v0.8.1
Published
npm registry & proxy server
Downloads
54
Readme
morose
Run npm registry or npm proxy on your own servers.
morose
allows you to have a local npm registry with zero configuration. You don't have to install and replicate an entire CouchDB database. morose
keeps its own small database and, if a package doesn't exist there, it asks npmjs.org for it keeping only those packages you use.
Table of contents
- Compatibility
- Use Cases
- Installation
- Usage
- Running Tests
- Hacking on morose
- Setting up nginx reverse proxy
- Inspiration
Compatibility
morose
is compatible with npm
version 5
and beyond.
Use cases
- Use private packages.
If you want to use all benefits of npm package system in your company without sending all code to the public, and use your private packages just as easy as public ones.
- Cache npmjs.org registry.
If you have more than one server you want to install packages on, you might want to use this to decrease latency (presumably "slow" npmjs.org will be connected to only once per package/version) and provide limited failover (if npmjs.org is down, we might still find something useful in the cache).
- Override public packages.
If you want to use a modified version of some 3rd-party package (for example, you found a bug, but maintainer didn't accept pull request yet), you can publish your version locally under the same name.
Installation
$ npm install morose -g
Usage
Running a Server
morose
When you start a server for the first time, configuration is created in ~/.morose
directory.
Now you can navigate to http://localhost:10000
in your browser where your packages can seen and searched.
Setting up npm config to use morose
npm set registry http://localhost:10000
Running tests
- server unit tests
node tests/run.js
- server end-to-end tests
node tests/run_e2e.js
- app end-to-end Protractor tests
First make sure morose
is running, then;
npm run protractor
Hacking on morose
Running from source
- Clone this repository
git clone https://github.com/bleenco/morose.git --depth 1
- Build morose project
npm run build:prod
- Link morose to have global command
npm link
- Run command
morose
...or, you can skip steps 2.
, 3.
and 4.
and start project in dev mode
npm run dev
Setting up nginx reverse proxy
server {
listen 80;
server_name morose.example.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:10000;
}
}
Inspiration
morose
is heaviliy inspired by sinopia
and we also used some stuff from there.
The main reason to make a new package with similar behavior is that sinopia
is not updated anymore and as far as we know some npm
commands doesn't work there.
morose
is build with in the way that is compatible with the newest npm
releases.
LICENCE
MIT