
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@priestine/pipeline
Advanced tools
@priestine/pipeline
is a set of inverted monoids which are built from a composition of handlers called middleware and a data entry point called process.
The main goal of this package is a proof of concept that simplified representation of functional composition can lower the functional programming entry level. It also abstracts asynchrony by resolving Promises passed from one middleware to another.
The Pipeline can be concatenated with other Pipelines with concat
which enables multiple sets of middleware to be composed together.
concat
undefined
or null
, result of previous computation is passed to the next middlewarep.concat(o)
p.empty()
and P.empty()
npm i -S @priestine/pipeline
import { Pipeline } from "@priestine/pipeline";
import * as readline from "readline";
const addSpaceIfMissing = question => (question.charAt(question.length - 1) == " " ? question : question.concat(" "));
const transformToContextObject = question => ({ question });
const createReadlineInterface = ctx => ({
...ctx,
rl: readline.createInterface(process.stdin, process.stdout),
});
const askQuestionAsync = ({ rl, question }) =>
new Promise(res => rl.question(question, (answer: string) => res(answer)));
const makeAnswerGreen = (answer: string) => `\x1b[32m${answer}\x1b[0m`;
const logToConsole = (answer: string) => console.log(answer);
const exit = () => process.exit(0);
Pipeline.from([
addSpaceIfMissing,
transformToContextObject,
createReadlineInterface,
askQuestionAsync,
makeAnswerGreen,
logToConsole,
])
.process("What is the answer to life, the universe and everything?")
.then(exit);
import { Pipeline } from "@priestine/pipeline";
const isOdd = (num: number) => num % 2 == 0;
const negate = (f: Function) => (x: any) => !f(x);
const mockFetch = (x: string): Promise<number[]> => new Promise(resolve => resolve([1, 2, 3, 4, 5]));
const filterOutOddNumbers = (nums: number[]): number[] => nums.filter(negate(isOdd));
const logToConsole = (answer: number[]): void => console.log(answer);
Pipeline.of(mockFetch)
.pipe(filterOutOddNumbers)
.pipe(logToConsole)
.process("https://example.com/arbitrary-numbers")
.catch(console.error);
FAQs
Simple and reusable pipelines with abstracted asynchrony
We found that @priestine/pipeline 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.