1.0.3 • Published 8 years ago

harmony-event-emitter v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Harmony Event Emitter

NPM

Introduction

Harmony Event Emitter allows you to quickly integrate Harmony into any node workflow.

Quick Start

Install Harmony Event Emitter.

$ npm install harmony-event-emitter

Use Harmony Event Emitter.

var harmonyEventEmitter = require("harmony-event-emitter");

// DEV: Set the workspace if it is not the current working directory
// harmonyEventEmitter.setWorkspace("/path/to/workspace");

harmonyEventEmitter.setColor("Build Watch", "#A1B2C3");
harmonyEventEmitter.showSpinner("Build Watch");

harmonyEventEmitter.pushNotification("Lint Watch", "Failed", "3 errors", "Sosumi");

// DEV: More examples
setTimeout(function() {harmonyEventEmitter.hideSpinner("Build Watch");}, 2000);
setTimeout(function() {harmonyEventEmitter.remove("Lint Watch");}, 4000);

Functions

hideSpinner(name)

Hide a task's spinner. If necessary, the task will be automatically created.

ParamTypeDescription
namestringThe task's name.

pushNotification(name, subtitle, description, sound)

Show a task's spinner. If necessary, the task will be automatically created.

ParamTypeDescription
namestringThe task's name.
subtitlestringThe notification's subtitle. An empty string will hide the subtitle.
descriptionstringThe notification's description. An empty string will hide the description.
soundstringThe notification's sound. An empty string will result in the system default sound. A void or null string will result in no sound.

remove(name)

Remove a task.

ParamTypeDescription
namestringThe task's name.

setColor(name, color)

Show a task's color. If necessary, the task will be automatically created.

ParamTypeDescription
namestringThe task's name.
colorstringThe task's color. RGB hex format, leading # optional. (E.g. #A1B2C3)

setWorkspace(newWorkspace)

Set the workspace in which events will be written. The default value is the current working directory.

ParamTypeDescription
newWorkspacestringThe workspace in which events will be written.

showSpinner(name)

Show a task's spinner. If necessary, the task will be automatically created.

ParamTypeDescription
namestringThe task's name.

License

Harmony Event Emitter may be freely distributed under the MIT license.

Copyright (c) 2016 Evernaut

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.1

8 years ago