Git Product home page Git Product logo

npmserve-server's Introduction

npmserve-server

npm

This server provides npm as a service accessible via http endpoints. This allows virtual machines and other slow clients to offload the work of building node_modules and thus perform significantly faster installs.

disclaimer

npmserve and npmserve-server are experimental projects. These tools should not be used for deploying production dependencies. The client/server model does not yet have authentication or authorization in place. This project also does not guarantee the integrity or security of dependencies installed from npm or distributed to clients. Please consider your own requirements and constraints before incorporating npmserve into your workflow.

clients

  1. command-line client: available at npmserve.

  2. web interface: the server provides a web interface to delete and trigger builds:

web interface

implementation

To solve these problems, we are providing a server on which clients can execute their npm installs by uploading a package.json file. In response, they will receive a node_modules.tar.gz archive containing their install results.

limitations

Currently, the server must be run on a machine with the same architecture as the clients. If this is not the case, calls to /npm/install may return node_modules archives containing extensions compiled for the wrong architecture.

build semantics

To the extent possible, the npmserve server provides operations analogous to those that a user running npm locally might do. Users running locally often resort to forceful actions such as deleting their entire node_modules directory or clearing their cache. We provide the facility to perform those actions via the API as well. These are documented below.

API

POST /npm/install

  • behavior: performs an npm install on the server
  • arguments: packageJson: string of package.json file contents
  • content-type: application/x-www-form-urlencoded; charset=utf-8
  • response: compressed archive node_modules.tar.gz, containing node_modules

DELETE /npm/install/:hash

  • behavior: deletes the node_modules build on the server for the specified build hash
  • arguments: none
  • response: void

POST /npm/cache/clean

  • behavior: clears the .npm cache on the server
  • arguments: none
  • response: void

environment

This project relies on the following environment variables:

name type default description
BUILD_DATA_DIR string ./data path to the directory in which to store build data
NPM_CONFIG_REGISTRY string https://registry.npmjs.org the npm registry to use for npm install

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.