theoy / npm-git-publish

Share/publish private packages using Git remotes!
MIT License
5 stars 9 forks source link

npm-git-publish Stories in Ready Linux Build Status

Share/publish private packages using Git remotes!

NPM, for eons (circa 2012), has supported the ability to install from a Git URL. Installing from a Git URL has many advantages, but as of yet NPM does not include the ability to publish to a Git URL/feed out of the box.

However, there are many reasons why you may wish to use it:

Note, the best experience for NPM packages is still with an official registry server. You can find out more about user experience differences for packages installed from Git on the official NPM Git Roadmap Page .

Design

Currently, for simplicity this package is available only in API form. As an API it is currently designed in the following way:

Install

Typically you would use this package as a library, as part of your dev scripts.

npm install -D npm-git-publish

API

import publish from 'npm-git-publish';

publish(packageDir, gitRemoteUrl [, options] )
    .then(result => {
        // respond to whether publishing occurred
        // (e.g. print something to stdout)
        if (result.conclusion === publish.PUSHED) {

        } else if (result.conclusion === publish.SKIPPED) {

        } else if (result.conclusion === publish.CANCELLED) {

        }
    });

parameters

options