Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
stream-to-promise-agnostic
Advanced tools
Convert streams (readable or writable) to promises using your own standard Promise library.
(Built using TypeScript. Type declarations are embedded.)
Convert streams (readable or writable) to promises using your own standard Promise library.
import Promise from 'bluebird; // Or any constructor compatible promise like library of your choice.
import streamToPromise from 'stream-to-promise-agnostic';
const convert = streamToPromise(Promise,true); // 'true' indicates a Promise constructor
streamToPromise
can take any PromiseConstructorLike
(see lib.d.ts) constructor when the second param equals true
import {streamToPromise,PromiseFactory,Executor} from 'stream-to-promise-agnostic';
const QPromiseFactory:PromiseFactory = <T>(e:Executor<T>)=>require("q").promise(e);
const convert = streamToPromise(QPromiseFactory);
convert.toPromise(readableStream).then(array=> {
// array.length === 3
});
readableStream.emit('data', 1);
readableStream.emit('data', 2);
readableStream.emit('data', 3);
readableStream.emit('end'); // promise is resolved here
convert.toPromise(writableStream).then(()=> {
// resolves undefined
});
writableStream.write('data');
writableStream.end(); // promise is resolved here
FAQs
Convert streams (readable or writable) to promises using your own standard Promise library.
The npm package stream-to-promise-agnostic receives a total of 2 weekly downloads. As such, stream-to-promise-agnostic popularity was classified as not popular.
We found that stream-to-promise-agnostic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.