Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

jpubsub

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpubsub

Simple PubSub

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
14
Maintainers
1
Weekly downloads
 
Created
Source

jpubsub - Simple Javascript PubSub

Install

yarn add jpubsub
# or
npm install -S jpubsub
import makePublisher from 'jpubsub'
import type {Subscriber} from 'jpubsub' // generic type Subscriber<T>
// or
const pubsub = require('jpubsub')

// define a subscriber
const subscriber: Subscriber<string> = (data) => {
		console.log(data)
}
// create a publisher
const pubsliher = makePubsliher<string>()
// subscribe
const unsubscribe = publisher.subscribe(subscriber)
// publish
publisher.publish('hello')
// unsubscribe
unsubscribe()

FAQs

Package last updated on 07 Aug 2023

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