Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "chnl", | ||
"version": "0.1.1", | ||
"description": "Simple and powerful javascript channels (events)", | ||
"version": "0.1.2", | ||
"description": "Simple javascript channels compatible with Chrome extensions events API", | ||
"main": "./lib/index.js", | ||
"author": { | ||
@@ -10,20 +11,20 @@ "name": "Vitaliy Potapov", | ||
"scripts": { | ||
"code": "eslint ./index.js /test", | ||
"test": "ava", | ||
"eslint": "eslint /src /test", | ||
"check-deps": "check-dependencies --only-specified", | ||
"code": "npm run check-deps && npm run eslint", | ||
"test": "npm run check-deps && ava", | ||
"coveralls": "coveralls < coverage/lcov.info", | ||
"clean": "rm -rf ./lib", | ||
"compile": "babel ./src --out-dir ./lib", | ||
"prepublish": "npm run clean && npm run compile", | ||
"release-patch": "npm run code && npm test && npm version patch && npm publish && git push --follow-tags" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/vitalets/chnl.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vitalets/chnl/issues" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"ava": "^0.14.0", | ||
"babel-cli": "^6.9.0", | ||
"babel-eslint": "^6.0.3", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-register": "^6.8.0", | ||
"check-dependencies": "^0.12.0", | ||
"coveralls": "^2.11.9", | ||
@@ -46,7 +47,18 @@ "eslint": "^2.8.0", | ||
"source": [ | ||
"./index.js" | ||
"./src/index.js" | ||
], | ||
"require": "babel-register", | ||
"verbose": true | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/vitalets/chnl.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vitalets/chnl/issues" | ||
}, | ||
"license": "MIT", | ||
"contributors": [ | ||
"Amo Stepanyan (https://github.com/withw)" | ||
] | ||
} |
@@ -1,4 +0,3 @@ | ||
# Simple and powerful javascript channels | ||
Implementation of channels (events, pub/sub pattern) in plain javascript. | ||
API is inspired by [Chrome extensions events](https://developer.chrome.com/extensions/events#type-Event). | ||
# Simple javascript channels | ||
Implementation of channels (aka events, pub/sub, dispatcher) inspired and compatible with [Chrome extensions events API](https://developer.chrome.com/extensions/events#type-Event). | ||
@@ -16,5 +15,8 @@ ## Installation | ||
// import chnl | ||
// import es5 code | ||
import Channel from 'chnl'; | ||
// import es6 code | ||
import Channel from 'chnl/src'; | ||
// create channel | ||
@@ -39,2 +41,7 @@ exports.onChanged = new Channel(); | ||
// mute channel (optionally you can accumulate events to dispatch them after unmute) | ||
moduleA.onChanged.mute({accumulate: true}); | ||
// unmute channel | ||
moduleA.onChanged.unmute(); | ||
``` | ||
@@ -41,0 +48,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13282
362
55
12
1