git-modules

0.1.20 • Public • Published

git-modules

git-modules is a multi scoped npm-repository based on a single git repository.

Setup

  • create a workspace (any directory will work)
  • create an empty "git-modules.json" inside your workspace (empty means "{}")
  • "git init" your workspace
  • create a package directory within workspace
  • create a scope inside the package directory (a directory starting with an "@" char)
  • create a node package inside a scope

If you did everything correctly, you should have a directory structure like this:

  • workspace/packages/@scope/mypackage/package.json
  • workspace/git-modules.json

HINT: You can change "@scope" to "@whateveryouwant"

Usage

Install git-modules

    npm install git-modules

Start repository server (cwd: workspace/node_modules/git-modules)

    node index.js

This will start a local bound npm server on port 9292 You can change the port by setting "port" in the "git-modles.json"

    {
        port:9393
    }

Publish your package (cwd: workspace/packages/@scope/mypackage)

   npm publish

Install the latest package

$ npm install @scope/mypackage

Install a specific version (use --save as usual if you want)

$ npm install @scope/mypackage@0.0.1

Using npm to create a patch version (cwd: workspace/packages/@scope/mypackage)

   npm version patch

Republish your patched package (cwd: workspace/packages/@scope/mypackage)

   npm publish

Use your package

var mypackage = require('@scope/mypackage');

How it works

We create a http server to simulate a npm repository. Under the hood we start some shell git commands on every http request. "git archive" is used to create the tar package we send to the npm client. The publishing is based on git tags.

Problems ? Questions ? Answers ? Happy to hear.

Package Sidebar

Install

npm i git-modules

Weekly Downloads

0

Version

0.1.20

License

none

Last publish

Collaborators

  • chbrock