Socket
Book a DemoInstallSign in
Socket

hyperlapse

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperlapse

Distributed process manager

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

hyperlapse stability

npm version build status test coverage downloads js-standard-style

Distributed process manager. Listens on a hypercore feed for JSON commands to execute on the host machine using psy.

CLI API

  Usage:
    $ hyperlapse <command> [options]

  Commands:
    listen <hypercore key>             Listen for commands and print a log key
    append <hypercore key> <command>   Append commands onto a feed
    list   <hypercore key>             Print the services on a machine

  Process commands:
    start <package-name@version>   Boot up a service on the host machine
    stop
    remove
    restart

  Options:
    -h, --help              Print usage
    -v, --version           Print version

JS API

var hyperlapse = require('hyperlapse')
var normcore = require('normcore')

// the command feed usually lives remotely
var commandFeed = normcore('command-feed')
var commandKey = commandFeed.key.toString('hex')

var inFeed = normcore(commandKey)
var outFeed = normcore('out-feed')
hyperlapse(inFeed, outFeed)

outFeed.createReadStream().pipe(process.stdout)
var outKey = outFeed.key.toString('hex')
console.log('outFeed key is ' + outKey)

commandFeed.append(JSON.stringify({
  type: 'start',
  name: 'hypercore-archiver-bot',
  source: 'hypercore-archiver-bot@1.1.3',
  command: 'hypercore-archiver-bot --channel=#dat --port=8000'
}) + '\n')

Process commands

Start

Start a new process on the machine.

{
  "type": "start",
  "name": "what the process should be named on the machine",
  "source": "e.g. my-cool-service-on-npm@3.4.7",
  "env": {
    "a bunch": "of env vars"
  }
}

Stop

Stop a process on the machine

{
  type: "stop",
  "name": "my-cool-process"
}

Restart

Restart a process on the machine

{
  type: "restart",
  "name": "my-cool-process"
}

Remove

Remove a process on the machine

{
  type: "remove",
  "name": "my-cool-process"
}

API

agent = hyperlapse(inFeed, outFeed)

Create a new agent that tails a hypercore. Reads commands from the inFeed and logs its output to the outFeed.

Installation

$ npm install hyperlapse

See Also

License

MIT

Keywords

process

FAQs

Package last updated on 19 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts