GithubHelp home page GithubHelp logo

kappa's Introduction

kappa

Lead Maintainer: Shaun Warman

Build Status
NPM version

Based on [npm-delegate] (https://npmjs.org/package/npm-delegate) by Jason Denizac [email protected], this module is a hapi plugin used to proxy npm to support private npm repos without replicating the entire public registry.

NOTE: The config.json described below is a Hapi Composer manifest that describes kappa as a plugin. See ./example/global/config.json or ./example/local/config.json for more information.

Quickstart

TL;DCO (too long; didn't check out)

Using docker-compose, just run docker-compose up in a directory containing our docker-compose.yml file. Soon after you'll have a working kappa instance set up to use a local couch instance (falling back to the public registry) on 0.0.0.0:8000.

Global Installation
$ npm install -g kappa
$ kappa -c config.json
Local Installation

If you choose to install locally, running kappa is as easy as

$ npm init
$ npm install --save kappa

# add start script to package.json:
#    "scripts": {
#        "start": "kappa -c config.json",
#    }

$ npm start

You can then put those artifacts (config.json and package.json) under source control for simple deployments later:

$ git clone [email protected]:me/myregistry.git
$ cd myregistry
$ npm install
$ npm start

Options

kappa plugin currently supports the following parameters

  • vhost - the virtual host associated with the kappa server, e.g. 'npm.mydomain.com'
  • paths (optional) - any ordered array of npm repositories to use, e.g. Defaults to ['http://localhost:5984/registry/_design/app/_rewrite/', 'https://registry.npmjs.org/']
  • rewriteTarballs (optional) - When true rewrites the tarball URL in packages to download each resource via kappa. When false, tarball URLs are left untouched, allowing the client to download package tarballs directly from the registry that fulfilled the package request. Defaults to true.

For read operations (GET, HEAD, etc) the proxy will first attempt to fetch the module from the first registry. If the requested module is not found it continues to the next registry, and so on.

For write operations the proxy will only attempt to write to the FIRST registry. All auth occurs with the first registry as well.

FAQs

I'm seeing npm install fail after a couple of minutes with: npm ERR! shasum check failed for ...

This is likely a result of the download exceeding node's default socket idle timeout. The best way to address this is by disabling the socket timeout for your server in the manifest.

{
    "host": "localhost",
    "port": 8000,
    "options": {
        "timeout": {
            "socket": false
        }
    }
}

kappa's People

Contributors

totherik avatar jasisk avatar tlivings avatar aredridel avatar junosuarez avatar jeffharrell avatar kidkarolis avatar alexsantos avatar grawk avatar ns3777k avatar pvenkatakrishnan avatar palavilli-godaddy avatar robertjustjones avatar samsel avatar

Watchers

James Cloos avatar Hafeez Syed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.