{"id":42416,"library":"array-join","title":"array-join","description":"Join (SQL-like) two iterables by a common key. v4.0.0 is the current stable version, ESM-only, requires Node >=22. Provides INNER JOIN, LEFT JOIN, and FULL JOIN operations on iterables. The user supplies key extractors and a result constructor. v3 introduced a simplified interface and up to 10x performance improvement. v3 dropped custom match functions and made all parameters required. v4 dropped CJS support and raised minimum Node version. Key differentiator: lightweight, typed (TypeScript), and fast for object array joins without a database.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/iredchuk/array-join","tags":["javascript","array","arrays","iterable","join","left-join","full-join","util","typescript"],"install":[{"cmd":"npm install array-join","lang":"bash","label":"npm"},{"cmd":"yarn add array-join","lang":"bash","label":"yarn"},{"cmd":"pnpm add array-join","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v4; CommonJS require will fail.","wrong":"const join = require('array-join').join","symbol":"join","correct":"import { join } from 'array-join'"},{"note":"Named export, not default.","wrong":"import leftJoin from 'array-join'","symbol":"leftJoin","correct":"import { leftJoin } from 'array-join'"},{"note":"Export name is camelCase: fullJoin.","wrong":"import { fulljoin } from 'array-join'","symbol":"fullJoin","correct":"import { fullJoin } from 'array-join'"}],"quickstart":{"code":"import { join } from 'array-join';\n\nconst people = [\n  { id: 1, name: 'Bob' },\n  { id: 2, name: 'Mary' },\n  { id: 3, name: 'Alice' },\n];\n\nconst addresses = [\n  { personId: 1, address: { city: 'New York', country: 'US' } },\n  { personId: 2, address: { city: 'Toronto', country: 'Canada' } },\n  { personId: 4, address: { city: 'London', country: 'UK' } },\n];\n\nconst result = join(\n  people,\n  addresses,\n  (left) => left.id,\n  (right) => right.personId,\n  (left, right) => ({ ...left, ...right })\n);\n\nconsole.log(result);","lang":"typescript","description":"Shows INNER JOIN of two arrays by matching id and personId, combining properties."},"warnings":[{"fix":"Switch to import syntax. If using Node, set type: module in package.json or use .mjs extension.","message":"ESM-only package: CommonJS require() will throw.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade Node.js to >=22.","message":"Minimum Node.js version is 22. Older versions cannot run v4.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Provide all four functions: leftKey, rightKey, resultItem.","message":"All parameters are required; omitting any will throw a runtime error.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Choose the correct function based on desired join semantics.","message":"join() performs INNER JOIN; leftJoin() for LEFT JOIN; fullJoin() for FULL JOIN. Do not expect all functions to behave identically.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Ensure keys are primitives (string, number, symbol, boolean, undefined, null).","message":"Key equality uses SameValueZero (like Map). Object keys by reference won't match custom objects.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'10x':54 '22':25 'array':2,85,91,92 'array-join':1 'cjs':69 'common':12 'constructor':45 'current':17 'custom':59 'databas':89 'differenti':77 'drop':58,68 'esm':21 'esm-on':20 'extractor':41 'fast':82 'full':32,99 'full-join':98 'function':61 'improv':56 'inner':27 'interfac':50 'introduc':47 'iter':9,36,93 'javascript':90 'join':3,4,28,30,33,86,94,97,100 'key':13,40,76 'left':29,96 'left-join':95 'lightweight':78 'like':7 'made':63 'match':60 'minimum':73 'node':24,74 'object':84 'oper':34 'paramet':65 'perform':55 'provid':26 'rais':72 'requir':23,66 'result':44 'simplifi':49 'sql':6 'sql-like':5 'stabl':18 'suppli':39 'support':70 'two':8 'type':79 'typescript':80,102 'user':38 'util':101 'v3':46,57 'v4':67 'v4.0.0':14 'version':19,75 'without':87","created_at":"2026-06-05T16:54:53.531579+00:00","updated_at":"2026-06-05T16:54:53.531579+00:00","problems":[{"fix":"Use import syntax: import { join } from 'array-join'","cause":"Using require() on an ESM-only package (v4+).","error":"ERR_REQUIRE_ESM: require() of ES Module"},{"fix":"Provide all three function arguments.","cause":"Missing a required parameter (getLeftKey, getRightKey, or getResultItem).","error":"TypeError: getLeftKey is not a function"},{"fix":"Pass only arrays or other iterables (e.g. Set, Map values).","cause":"Passed a non-iterable (e.g. plain object) as leftCollection or rightCollection.","error":"Error: The other collection is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/iredchuk/array-join#readme","github":"https://github.com/iredchuk/array-join","docs":null,"changelog":null,"pypi":null,"npm":"array-join","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}