harmony-event-emitter

1.0.3 • Public • Published

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.

pushNotification(name, subtitle, description, sound)

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

remove(name)

Remove a task.

setColor(name, color)

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

setWorkspace(newWorkspace)

Set the workspace in which events will be written.

showSpinner(name)

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

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    0
    • latest

Version History

Package Sidebar

Install

npm i harmony-event-emitter

Homepage

evernaut.com

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators