Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@aeinbu/groupby
Advanced tools
Lightweight and non-intrusive functions for doing "group by" type transformations on collections using reducers
Lightweight and non-intrusive functions for doing "group by" and "distinct" (aka. "unique") transformations on collections using reducers
.map(...)
, .filter(...)
and other built-in array functionsMap
.reduce(...)
on arrays.With npm
npm install @aeinbu/groupby
...or with yarn
yarn add @aeinbu/groupby
import { groupBy, toMap } from "@aeinbu/groupby"
const people = [
{name: "Tony", residence: "Rome"},
{name: "Mary", residence: "Rome"},
{name: "Peter", residence: "London"},
{name: "Peter", residence: "Rome"},
{name: "Elisabeth", residence: "London"},
{name: "Francois", residence: "Paris"}
]
const results = people
.reduce(groupBy(x => x.name, x => x.residence), [])
.reduce(toMap(x => x.name), new Map())
// With the same results as above:
// {
// "Rome": ["Tony", "Mary", "Peter"],
// "London": ["Peter", "Elisabeth"],
// "Paris": ["Francois"]
// }
For more documentation, follow these links:
Also, look in the tests
directory for more examples. The tests demonstrate at least another dozen different ways to use this library
This package follows semantic versioning (See semver.org for more info)
This package is published under the MIT License. (See LICENSE file for more info)
FAQs
Lightweight and non-intrusive functions for doing "group by" type transformations on collections using reducers
The npm package @aeinbu/groupby receives a total of 2 weekly downloads. As such, @aeinbu/groupby popularity was classified as not popular.
We found that @aeinbu/groupby 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.