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

dot-event

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-event

Powerful event emitter

  • 3.0.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
91
increased by4450%
Maintainers
1
Weekly downloads
 
Created
Source

dot-event

Javascript event emitter, foundation of everything.

neutron star

Buzzwords

  • Amazing logging
  • Async-first
  • Extend any event (before, during, after)
  • Dependency decoupling
  • Micro (<1kb compressed & gzipped)

Story

One day, a dot instance was born:

dot = require("dot-event")()

Each time dot went into a composer, the composer added some functionality to it:

module.exports = function(dot) {
  dot.any("sayHi", function() {
    console.log("hi!")
  })
}

The user had an easy time composing their dot:

require("./hi")(dot)
require("./whatsUp")(dot)
require("./yo")(dot)

dot.sayHi()

Far away, a library author noticed the first argument behaves as expected...

dot.any("say", function(arg) {
  console.log("arg:", arg)
})

dot.say("yo") // arg: yo

But the second argument does not!

dot.any("say", function(arg, opts) {
  console.log("arg:", arg)
  console.log("opts:", opts)
})

dot.say("yo", "hello")
// arg: hello
// opts: { dot: <DotEvent>, ns: "say", prop: "yo", propArr: ["yo"] }

And adding even more arguments only added more props!

dot.say("sup", "yo", "hello")
// arg: hello
// opts: { dot: <DotEvent>, ns: "say", prop: "sup.yo", propArr: ["sup", "yo"] }

And thus their journey began...

Existing dot composers

LibraryDescriptionURL
argRun functions from CLI or webhttps://github.com/dot-event/arg
logLog functionshttps://github.com/dot-event/log2
storeImmutable storehttps://github.com/dot-event/store2

Keywords

FAQs

Package last updated on 11 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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