{"id":43480,"library":"nodejs-polars","title":"nodejs-polars","description":"nodejs-polars is a Node.js binding for the Polars DataFrame library, built on Rust for performance. Version 0.24.1 requires Node >= 20, ships TypeScript types, and supports ESM and CJS. It provides fast data manipulation via lazy and eager APIs, with features like groupby, join, sort, and window functions. Key differentiators: significantly faster than pandas, lower memory usage, and a more expressive API. Released frequently (weekly/monthly), tracking the Rust core.","status":"active","version":"0.24.1","language":"javascript","source_language":"en","source_url":"https://github.com/pola-rs/nodejs-polars","tags":["javascript","csv","transform","parse","json","polars","dataframe","data-processing","rust","typescript"],"install":[{"cmd":"npm install nodejs-polars","lang":"bash","label":"npm"},{"cmd":"yarn add nodejs-polars","lang":"bash","label":"yarn"},{"cmd":"pnpm add nodejs-polars","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Both ESM and CJS supported. ESM is recommended for Node >= 20.","wrong":"const pl = require('nodejs-polars')","symbol":"pl","correct":"import pl from 'nodejs-polars'"},{"note":"Named export for TypeScript type usage.","wrong":"const { DataFrame } = require('nodejs-polars')","symbol":"DataFrame","correct":"import { DataFrame } from 'nodejs-polars'"},{"note":"Named export for TypeScript type usage.","wrong":"","symbol":"Series","correct":"import { Series } from 'nodejs-polars'"}],"quickstart":{"code":"import pl from 'nodejs-polars';\n\n// Create a DataFrame\nconst df = pl.DataFrame({\n  name: [\"Alice\", \"Bob\", \"Charlie\"],\n  age: [25, 30, 35],\n  city: [\"New York\", \"London\", \"Paris\"]\n});\n\n// Perform operations\nconst filtered = df.filter(pl.col(\"age\").gt(25));\nconst aggregated = df.groupBy(\"city\").agg(pl.col(\"age\").mean());\n\nconsole.log(filtered);\nconsole.log(aggregated);\n\n// Lazy API\nconst lf = df.lazy()\n  .filter(pl.col(\"age\").gt(25))\n  .select([\"name\", \"age\"]);\nconst result = await lf.collect();\nconsole.log(result);","lang":"typescript","description":"Demonstrates creating a DataFrame, filtering, grouping, and the lazy API with collect."},"warnings":[{"fix":"Use default import for the main pl object.","message":"Default import uses `import pl from 'nodejs-polars'`, not named imports.","severity":"gotcha","affected_versions":"*"},{"fix":"Use `await lf.collect()` and ensure calling context is async.","message":"Version 0.14.0 changed the lazy API to require async `collect()`.","severity":"breaking","affected_versions":">=0.14.0"},{"fix":"Pass arguments as a configuration object instead of positional booleans.","message":"Some function parameters have been renamed; e.g., `sort(descending: true)` changed to `sort({ descending: true })`.","severity":"deprecated","affected_versions":">=0.18.0"},{"fix":"Use `.get(idx)` for negative indices or slice.","message":"Series indices are zero-based but normal array indexing works; negative indexing is not supported.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to Node.js >=20.","message":"Minimum Node.js version is now 20; older versions are not supported.","severity":"breaking","affected_versions":">=0.24.0"},{"fix":"Continue using `pl.lit()` as it's still current.","message":"`pl.lit()` is used for literal values; there's no alternative at this time.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.24.1':22 '20':25 'api':43,66 'bind':10 'built':16 'cjs':33 'core':73 'csv':75 'data':37,82 'data-process':81 'datafram':14,80 'differenti':54 'eager':42 'esm':31 'express':65 'fast':36 'faster':56 'featur':45 'frequent':68 'function':52 'groupbi':47 'javascript':74 'join':48 'json':78 'key':53 'lazi':40 'librari':15 'like':46 'lower':59 'manipul':38 'memori':60 'node':24 'node.js':9 'nodej':2,5 'nodejs-polar':1,4 'panda':58 'pars':77 'perform':20 'polar':3,6,13,79 'process':83 'provid':35 'releas':67 'requir':23 'rust':18,72,84 'ship':26 'signific':55 'sort':49 'support':30 'track':70 'transform':76 'type':28 'typescript':27,85 'usag':61 'version':21 'via':39 'weekly/monthly':69 'window':51","created_at":"2026-06-05T17:00:00.183943+00:00","updated_at":"2026-06-05T17:00:00.183943+00:00","problems":[{"fix":"Use `import pl from 'nodejs-polars'` in your code, or ensure your Node.js version supports ESM and add `\"type\": \"module\"` to your package.json.","cause":"Using `require()` on an ESM-only module.","error":"Error: Must use import to load ES Module: /path/to/node_modules/nodejs-polars/lib/index.js"},{"fix":"Use `pl.DataFrame({...})` directly for constructing DataFrames.","cause":"Attempting to import named export 'DataFrame' from default import pl. Actually, pl.DataFrame is a method, not a class constructor in older versions.","error":"TypeError: pl.DataFrame is not a constructor"},{"fix":"Use `await lf.collect()` and ensure the surrounding function is async.","cause":"Incorrect usage of lazy API: `collect` is not called or called synchronously.","error":"TypeError: Cannot read properties of undefined (reading 'collect')"}],"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/pola-rs/nodejs-polars#readme","github":"https://github.com/pola-rs/nodejs-polars","docs":null,"changelog":null,"pypi":null,"npm":"nodejs-polars","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","analytics"],"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}}