lerna-npm-proxy

1.1.1 • Public • Published

lerna-npm-proxy

NPM TypeScript Coverage Status GitHub Stars

Serve Lerna packages without publishing to a registry.

Installation

yarn add lerna-npm-proxy
npm install lerna-npm-proxy

Installation

yarn add lerna-npm-proxy
npm install lerna-npm-proxy

CLI Usage

Running the server will allow you to use http://localhost:4873 to serve packages in your Lerna monorepo:

yarn lerna-npm-proxy

Then, in another terminal window:

yarn add @my-org/my-package --registry http://localhost:4873

This is especially useful for installing packages inside a docker container during development.

CLI Options

Usage: lerna-npm-proxy [options]

Serve Lerna packages as an NPM proxy.

Options:
  -v --version              Output the version number
  -p --port <port>          Port to listen on. Default: 4873
  -r --registry <registry>  Registry to proxy from
  -s --silent               Prevent logging. Default: false
  -w --while <script>       Script to run once server starts. Server will be killed once the script exits.
  -h --help                 Display help for command

Commands:
  help [command]            Display help for command

Node API

import { start } from "lerna-npm-proxy";

start();

Types

import { start, Options, FastifyInstance } from "lernal-npm-proxy";

function start(options?: Options): Promise<FastifyInstance>;

type Options = {
    /**
     * Port to listen on. Default: 4873.
     */
    port?: number;
    /**
     * Registry to proxy from.
     */
    registry?: string;
    /**
     * Prevent logging. Default: false.
     */
    silent?: boolean;
    /**
     * Script to run once server starts. Server will be killed once the script exits.
     * This also disables server logging.
     * NOTE: this is passed directly to `child_process.spawn`.
     */
    while?: string;
};

Dependenciesdependencies


Peer DependenciesDavid

  • lerna: A tool for managing JavaScript projects with multiple packages.

Dev DependenciesDavid


License license

MIT

Package Sidebar

Install

npm i lerna-npm-proxy

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

20 kB

Total Files

16

Last publish

Collaborators

  • bconnorwhite