New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

heehaw

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heehaw

A tiny event emitter for Deno and Node.js

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Heehaw

Heehaw is a tiny event emitter based on the Node.js EventEmitter but not feature complete.

Deno import

  • latest - import { EventEmitter } from "https://gitlab.com/rhythnic/heehaw/-/raw/master/src/mod.ts"
  • versioned - import { EventEmitter } from "https://gitlab.com/rhythnic/heehaw/-/raw/VERSION/src/mod.ts"

NPM install

npm install heehaw

Usage

import { EventEmitter } from 'heehaw'

const events = new EventEmitter()

function handler (...args) {
  console.log(args.join(' '))
}

events.on('hello', handler)
events.emit('hello', 'Hello', 'World')

events.off('hello', handler)

// remove all listeners
events.listeners('hello').forEach(x => events.off('hello', x))

API

on(topic, handler)

once(topic, handler)

off(topic, handler)

emit(topic[, ...args])

listeners(topic)

LICENSE

MIT license, Copyright Nicholas Baroni 2020

Keywords

event

FAQs

Package last updated on 31 Aug 2020

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