
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
underscore-groups-by
Advanced tools
A many-to-many version of underscore's _.groupBy
.
This module should work with plain old javascript, browserify, and requirejs.
For regular javascript, make sure you include it after underscore. Underscore is the only dependency.
For browserify and requirejs, you need to require
it, but you don't need to do anything with the return value if you don't want -- it will mix itself into underscore for you.
$ npm install groups-by
var _ = require('underscore');
require('underscore-groups-by');
var things = [
{n: [1], name: 'alice'},
{n: [2], name: 'bob'},
{n: [1, 2], name: 'alob'}
];
var grouped = _(things).groupsBy(function (thing) {
return thing.n; // return value must be an array
});
logging the result...
console.log(grouped);
should yield
{
1: [
{n: [1], name: 'alice'},
{n: [1, 2], name: 'alob'}
],
2: [
{n: [2], name: 'bob'},
{n: [1, 2], name: 'alob'}
]
}
MIT
FAQs
Many-to-many grouping of objects in a list.
The npm package underscore-groups-by receives a total of 11 weekly downloads. As such, underscore-groups-by popularity was classified as not popular.
We found that underscore-groups-by 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
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.