A JavaScript library providing SQL-style join algorithms for arrays of objects, built as an extension to Lodash. Current stable version 3.1.1, released in 2022, with low release cadence. Key differentiators: supports multiple join algorithms (nested loop, hash, sorted merge) and many join types (inner, left/right outer, full outer, left/right semi, left/right anti). Ships TypeScript types. Only dependency is Lodash. Coercive key comparisons support Dates and similar types.
npm install lodash-joinsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of hashInnerJoin with two arrays, key accessor strings, and a merger function.
Always import lodash-joins as a side-effect import: require('lodash-joins') or import 'lodash-joins'; do not attempt to destructure functions from it.Use a string for simple property access, or provide a function to extract nested values.
Update calls to sortedMerge* joins to match the new parameter order: (leftArray, leftKeyAccessor, rightArray, rightKeyAccessor, merger).
Do not use _.pluck; pass property name strings as accessors.
In merger, check that left or right is not null before accessing properties; use conditional operators.
Ensure you require or import lodash-joins after lodash: const _ = require('lodash'); require('lodash-joins'); Then use _.hashInnerJoin(...).In the merger, check for null: (left, right) => ({ name: left ? left.name : null, ... })Update to new order: (leftArray, leftKeyAccessor, rightArray, rightKeyAccessor, merger).