Registry / storage / pull-queue

pull-queue

JSON →
library0.1.4jsnpmunverified

A pull-stream based duplex stream with a built-in queue, version 0.1.4, maintained for the pull-stream ecosystem. It allows transforming or validating data as it passes through, with options like sendMany to split arrays into multiple items. Designed to avoid null reads by returning a duplex stream. Lightweight, no dependencies, and integrates seamlessly with other pull-stream utilities.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Default export only; named import will be undefined.

import queue from 'pull-queue'

CommonJS users must use default require, not destructuring.

const queue = require('pull-queue')

pull-queue does not export TypeScript types; use pull-stream types.

import type { Duplex } from 'pull-stream'

Demonstrates a queue stream that filters out non-numeric values using a validation function.

const pull = require('pull-stream'); const queue = require('pull-queue'); // Validate data: only allow numbers const validate = queue(function(end, data, cb) { if (end) return cb(end); if (typeof data === 'number') cb(null, data); else cb(); // skip invalid }); pull( pull.values([1, 'a', 2, 'b', 3]), validate, pull.collect((err, results) => { console.log(results); // [1, 2, 3] }) );
Debug
Known footguns
gotchaCallback with no arguments (cb()) silently drops the data; this is by design but can be non-obvious.
gotchaWhen sendMany is true, the callback can receive an array, and each element is emitted individually. If you pass a single array item, it may be treated as multiple items.
deprecatedNo deprecation warnings in current version, but the package uses older pull-stream patterns and may not be maintained for future pull-stream changes.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
amazonbot
1
Resources