Git Product home page Git Product logo

node-npkg's Introduction

NodeOS Package Manager

NodeOS uses NPM for package management, but the npm command is not sufficient for proper installation of NodeOS packages. The npkg command handles all OS-related package management. If you're writing a NodeJS app, you will still use the npm command locally.

Usage

Usage: npkg COMMAND PACKAGE

Commands:
  
  install      install package
  remove       remove package
  
  start        start service
  stop         stop service

Installing Packages

Installing via npkg install is a lot like npm install -g, except npkg only installs the package for the current user. Packages are installed to $HOME/lib/node_modules and binaries are linked to $HOME/bin. NodeOS will have a very minimal set of executables outside of $HOME/bin, thus a users command-line experience is almost completely isolated from other users on the system.

Removing a package only removes it for the current user. Packages and linked binaries are always partitioned by user, thus you do not need to be root to call npkg.

Binaries are discovered exactly like npm install via the bin key in package.json.

Starting Services

Packages can expose services as well as binaries. Calling npkg start PACKAGE is the same as calling npm start, only the stared service is run by init and daemonized.

The npkg start command can resolve both global and local packages. Local packages start with either ./ or / and are resolved as relative or absolute URLs. Global packages are resolved under $HOME/lib/node_modules.

Start a Relative Package

$ cd ~
$ npkg start ./myapp
--> starting ~/myapp
--> reading ~/myapp/package.json

Start a Global Package

$ cd ~
$ npkg start myapp
--> starting ~/lib/node_modules/myapp
--> reading ~/lib/node_modules/myapp/package.json

Programatic API

Access npkg programatically:

var npkg = require('npkg');
npkg.install(package, function(err,ok){
  // 
});
npkg.start(package, function(err,ok){
  //
});

node-npkg's People

Contributors

groundwater avatar

Watchers

 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.