it-queueless-pushable
A pushable queue that waits until a value is consumed before accepting another
Last updated 2 years ago by achingbrain .
Apache-2.0 OR MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install it-queueless-pushable 
SYNC missed versions from official npm registry.

it-queueless-pushable

codecov CI

A pushable queue that waits until a value is consumed before accepting another

About

Collects all Uint8Array values from an (async)iterable and returns them as a single Uint8Array.

Example

import toBuffer from 'it-to-buffer'

// This can also be an iterator, generator, etc
const values = [Buffer.from([0, 1]), Buffer.from([2, 3])]

const result = toBuffer(values)

console.info(result) // Buffer[0, 1, 2, 3]

Async sources must be awaited:

import toBuffer from 'it-to-buffer'

const values = async function * () {
  yield Buffer.from([0, 1])
  yield Buffer.from([2, 3])
}

const result = await toBuffer(values())

console.info(result) // Buffer[0, 1, 2, 3]

Install

$ npm i it-queueless-pushable

Browser <script> tag

Loading this module through a script tag will make it's exports available as ItQueuelessPushable in the global namespace.

<script src="https://unpkg.com/it-queueless-pushable/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Current Tags

  • 2.0.5                                ...           latest (8 months ago)

10 Versions

  • 2.0.5                                ...           8 months ago
  • 2.0.4                                ...           8 months ago
  • 2.0.3                                ...           a year ago
  • 2.0.2                                ...           a year ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 14
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE