Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arbitrary-emitter

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arbitrary-emitter - npm Package Compare versions

Comparing version 0.6.2 to 0.7.0

tests/test.html

4

arbitrary-emitter.js
'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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc