layar-client

0.2.0 • Public • Published

layar-client Build Status codecov.io Package Version

Tiny wrapper around websocket for easily connecting to layar server

Installation

$ npm install layar-client --save

Usage

var lc = require('layar-client');
var client = lc('http://layar.server.com')
 
// create a multiple section
var configSection = client('config_update');
var releaseSection = client('release_web');
 
// start a section
var currentHost = 'web01';
var info = { username: 'semmatabei', commitHash: '1fbb8fe' };
releaseSection.start(currentHost, info);
 
// end a section
// default status is 'completed'
releaseSection.end();
 
// or specify custom status
releaseSection.end('stopped');
 
// and add additional info
releaseSection.end('failed', { info: 'failed to do something '});
 
// send log
var logMessage = 'switching web01 traffic';
releaseSection.log(logMessage);
 
// abort section
// internally .abort() uses .end() with 'error' status
var errorMessage = 'failed to switch web01 traffic';
releaseSection.abort(errorMessage);

Readme

Keywords

Package Sidebar

Install

npm i layar-client

Weekly Downloads

1

Version

0.2.0

License

BSD-3-Clause

Last publish

Collaborators

  • pveyes