
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
pure-promise
Advanced tools
Collection of functional utilities for working with native promises
$ npm install pure-promise
# or
$ yarn add pure-promise
reduceSerially reduce an array, or promise for an array
import {reduce} from 'pure-promise';
const sum = await reduce([
Promise.resolve(1),
2,
3
], (prev, next) => prev + next);
console.log(sum); // 6
mapConcurrently map through an array, or promise for an array
import {map} from 'pure-promise';
const plusOne = await map([
1,
2,
Promise.resolve(3)
], (value) => value + 1);
console.log(plusOne); // [2, 3, 4]
mapSeriesSerially map through an array, or promise for an array
import {mapSeries} from 'pure-promise';
const plusOne = await mapSeries([
Promise.resolve(1),
2,
3
], (value) => value + 1);
console.log(plusOne); // [2, 3, 4]
filterConcurrently filter values from an array, or promise for an array
import {filter} from 'pure-promise';
const plusOne = await filter([
1,
Promise.resolve(2),
3
], (value) => value % 2 === 0);
console.log(plusOne); // [2]
propsConcurrently resolves an object or arrays values into their key/value pairs
import {props} from 'pure-promise';
const plusOne = await props({
key1: Promise.resolve(1),
key2: 2
});
console.log(plusOne); // { key1: 1, key2: 2 }
pipeConcurrently pipes the results of the previous function into the next
import {pipe} from 'pure-promise';
const pipeline = pipe(
(a) => a + 1, // a = 1
(b) => Promise.resolve(b * 2) // b = 2
);
const result = await pipeline(1);
console.log(result); // 4
FAQs
Collection of functional utilities for working with native promises
We found that pure-promise 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.