arbitrary-emitter
Advanced tools
Comparing version 0.6.2 to 0.7.0
'use strict' | ||
module.exports = function () { | ||
function arbitrary () { | ||
const links = new Map() | ||
@@ -58,1 +58,3 @@ | ||
} | ||
module.exports = arbitrary |
{ | ||
"name": "arbitrary-emitter", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"description": "Event emitter with Map/Set sugar", | ||
"main": "arbitrary-emitter.js", | ||
"scripts": { | ||
"test": "node ./test.js" | ||
"linter": "eslint arbitrary-emitter.js tests/tests.js", | ||
"test": "node ./tests/tests.js", | ||
"build-umd": "rm -rf dist && mkdir dist && cp umd-assets/preumd.txt dist/arbitrary-emitter.umd.js && cat arbitrary-emitter.js >> dist/arbitrary-emitter.umd.js && sed -i '$d' dist/arbitrary-emitter.umd.js && cat umd-assets/postumd.txt >> dist/arbitrary-emitter.umd.js", | ||
"build-tests": "mkdir tests/dist -p && browserify tests/tests.js -o tests/dist/tests.js", | ||
"build": "npm run build-umd && npm run build-tests", | ||
"postinstall": "npm run build-umd" | ||
}, | ||
@@ -9,0 +14,0 @@ "repository": { |
arbitrary-emitter | ||
================= | ||
Event emitter with Map/Set sugar for browser and node.js apps | ||
High performance event emitter with Map/Set sugar for browser and node.js apps | ||
[![Build Status](https://travis-ci.org/jacoborus/arbitrary-emitter.svg?branch=master)](https://travis-ci.org/jacoborus/arbitrary-emitter) | ||
**arbitrary-emitter** allows to use arbitrary values as keys for your events | ||
**arbitrary-emitter** stores listeners in a ES6 Map and the actions in ES6 Sets, this improves performance when emitting multiple actions and also allows to use arbitrary values as keys for your listeners | ||
**arbitrary-emitter** is written in vanilla ES6, so maybe you want to transpile it before using it. | ||
**arbitrary-emitter** is written in vanilla ES6, so you will have to transpile it before using it in old browsers or node.js < v5.9 | ||
**Project in active development, API may change** | ||
@@ -62,3 +61,3 @@ ## Create a new emitter | ||
<a name="emitter-emit-api"></a> | ||
## emitter.emit(key[, ...args]) | ||
### emit(key[, ...args]) | ||
@@ -75,3 +74,3 @@ `emit` methods binded to `key`, and pass the rest of the arguments to it | ||
<a name="emitter-off-api"></a> | ||
## emitter.off(key[, action]) | ||
### off(key[, action]) | ||
@@ -96,3 +95,16 @@ Remove `action` from listener `key`. If no action is specified will remove all listeners binded to `key` | ||
### Browser | ||
Build browser tests (`npm run build-tests`) and open `test/test.html` | ||
<a name="building"></a> | ||
## Building | ||
- Build UMD file: `npm run build-umd` | ||
- Build browser tests: `npm run build-tests` | ||
- Run both builds: `npm run build` | ||
<br><br> | ||
@@ -99,0 +111,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8617
10
128
112
1