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

sparkles

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparkles - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

15

index.js

@@ -8,4 +8,3 @@ 'use strict';

function getEmitter(namespace){
function getStore(){
var store = global[sparklesNamespace];

@@ -17,2 +16,9 @@

return store;
}
function getEmitter(namespace){
var store = getStore();
namespace = namespace || defaultNamespace;

@@ -32,6 +38,11 @@

return ee;
}
function exists(namespace){
var store = getStore();
return !!(store[namespace]);
}
module.exports = getEmitter;
module.exports.exists = exists;

23

package.json
{
"name": "sparkles",
"version": "0.1.0",
"version": "1.0.0",
"description": "Namespaced global event emitter",

@@ -14,23 +14,24 @@ "author": "Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",

"files": [
"index.js",
"LICENSE"
"LICENSE",
"index.js"
],
"scripts": {
"test": "lab -cv --ignore store@sparkles",
"lint": "jshint test index.js --reporter node_modules/jshint-stylish/stylish.js --exclude node_modules"
"test": "lab -cvL --ignore store@sparkles"
},
"dependencies": {},
"devDependencies": {
"code": "^1.2.1",
"jshint": "^2.5.10",
"jshint-stylish": "^1.0.0",
"lab": "^5.1.0"
"@phated/eslint-config-iceddev": "^0.2.1",
"code": "^1.5.0",
"eslint": "^1.3.1",
"eslint-plugin-mocha": "^0.5.1",
"eslint-plugin-react": "^3.3.1",
"lab": "^5.16.0"
},
"keywords": [
"global",
"ee",
"emitter",
"events",
"emitter",
"global",
"namespaced"
]
}

@@ -24,4 +24,15 @@ sparkles

# Why the name?
## API
### sparkles(namespace)
Returns an EventEmitter that is shared amongst the provided namespace. If no namespace
is provided, returns a default EventEmitter.
### sparkles.exists(namespace);
Checks whether a namespace exists and returns true or false.
## Why the name?
This is a "global emitter"; shortened: "glitter" but it was already taken; so we got sparkles instead :smile:

@@ -28,0 +39,0 @@

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