
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
nest-by-tuple
Advanced tools
Groups an array/object by property values or callback with support for additional metadata
Groups an array/object by property values or callback and supports additional metadata
Works like nest-by, but allows you to embed more metadata. Also see group-by or lodash.groupBy.
nestByTuple(object or array, property, [...properties])
property is typically a function that returns an array in the structure of:
[ indexString, metadata ]
Where indexString is a string that the group will be indexed by, and
metadata will be an Object that has data about that group.
genders = { m: 'Male', f: 'Female' }
list =
[ { name: 'Marge', gender: 'f' },
{ name: 'Homer', gender: 'm' },
{ name: 'Bart', gender: 'm' } ]
result = nestByTuple(list,
(person) => [ person.gender, { genderName: genders[person.gender] } ])
// f:
// genderName: 'Famale',
// values: [ { name: 'Marge', gender: 'f' } ]
// m:
// genderName: 'Male',
// values: [
// { name: 'Homer', gender: 'm' },
// { name: 'Bart', gender: 'm' } ]
list =
{ marge: { name: 'Marge', gender: 'f' },
homer: { name: 'Homer', gender: 'm' },
bart: { name: 'Bart', gender: 'm' } }
var result = nestBy(list,
(person) => [ person.gender, { genderName: genders[person.gender] } ])
// f:
// genderName: 'Famale',
// values:
// marge: { name: 'Marge', gender: 'f' }
// m:
// genderName: 'Male',
// values:
// homer: { name: 'Homer', gender: 'm' }
// bart: { name: 'Bart', gender: 'm' }
Yes, recursion is supported by passing in more property parameters.
nest-by-tuple © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).
ricostacruz.com · GitHub @rstacruz · Twitter @rstacruz
FAQs
Groups an array/object by property values or callback with support for additional metadata
We found that nest-by-tuple 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
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.