1.0.3 • Published 8 years ago
harmony-event-emitter v1.0.3
Harmony Event Emitter
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.
Param | Type | Description |
---|---|---|
name | string | The task's name. |
pushNotification(name, subtitle, description, sound)
Show a task's spinner. If necessary, the task will be automatically created.
Param | Type | Description |
---|---|---|
name | string | The task's name. |
subtitle | string | The notification's subtitle. An empty string will hide the subtitle. |
description | string | The notification's description. An empty string will hide the description. |
sound | string | The 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.
Param | Type | Description |
---|---|---|
name | string | The task's name. |
setColor(name, color)
Show a task's color. If necessary, the task will be automatically created.
Param | Type | Description |
---|---|---|
name | string | The task's name. |
color | string | The 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.
Param | Type | Description |
---|---|---|
newWorkspace | string | The workspace in which events will be written. |
showSpinner(name)
Show a task's spinner. If necessary, the task will be automatically created.
Param | Type | Description |
---|---|---|
name | string | The task's name. |
License
Harmony Event Emitter may be freely distributed under the MIT license.
Copyright (c) 2016 Evernaut