
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
@sweepbright/iter-helpers
Advanced tools
This project provides a collection of helper functions for working with asyncronous iterators in TypeScript.
This project provides a collection of helper functions for working with asyncronous iterators in TypeScript.
To install the package, run the following command:
npm install @sweepbright/iter-helpers
The chain
function is used to create a new instance of the Chain
class. The Chain
class represents a chain of iterable objects, allowing for easy composition and manipulation of iterators.
Overall, chain
provides a convenient way to work with iterable objects and perform operations on them in a chained manner.
Iter
- a convenient interface defining both synchronous and asynchronous iteratorSee the Diagrams for a visual representation of the API.
chain(iter)
- creates a new instance of the Chain
class.pipe(operator)
- transform an iterator using an operator.map(mapFn, errorMapFn)
- applies a function to each element of an iterator.concurrentMap(options, mapFn, errorMapFn)
- applies a function to each element of an iterator concurrently.filter(fn)
- filters elements of an iterator based on a predicate.take(n)
- returns the first n elements of an iterator.skip(n)
- returns the last n elements of an iterator.batch(n)
- splits an iterator into batches of size n
.interval(n)
- splits an iterator into intervals (tuples containing a pair of start and end items) of size n
.flatten()
- flattens an iterator of arrays into an iterator of elements.toArray()
- converts an iterator to an arraynew Fifo(options)
- creates a FIFO queuerange(start, end?, step?)
- creates an iterator of numbersmux(iterators)
- multiplexes multiple iterators into oneFAQs
This project provides a collection of helper functions for working with asyncronous iterators in TypeScript.
We found that @sweepbright/iter-helpers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.