on-one
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

on-one

Subscribe to one or more events and accept the first emitted.

one event

import oo = from 'on-one';

oo(stream, 'data', (chunk) => {
  // first chunk only
})

multiple events

import oo = from 'on-one';

oo(stream, ['error', 'finish'], (err) => {
  // it depends on if there was an error
})

Package Sidebar

Install

npm i on-one

Weekly Downloads

2,557

Version

0.1.4

License

MIT

Unpacked Size

7.24 kB

Total Files

8

Last publish

Collaborators

  • kmalakoff