LinqToTypeScript is an active library, currently at stable version 12.1.0, that ports the Language Integrated Query (LINQ) functionality from .NET to TypeScript. It provides a comprehensive set of methods for querying, transforming, and manipulating collections, inspired by the IEnumerable, IAsyncEnumerable, and IParallelEnumerable interfaces. The library supports both synchronous and asynchronous operations, leveraging modern JavaScript features like `AsyncIterable` and `generators`. It targets TypeScript 5.6.X and ES2022, shipping exclusively as ECMAScript Modules (ESM). Key differentiators include its dual usage pattern (explicit `from` wrapper or extending native types via `initializeLinq`), support for parallel operations, and consistent release cadence with new LINQ methods being regularly added.
npm install linq-to-typescriptNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates both the `from` wrapper and the native type extension pattern using `initializeLinq` for synchronous and asynchronous LINQ operations on arrays.
Migrate all `require()` statements to `import` statements. Ensure your `package.json` specifies `"type": "module"` or use a `.mjs` extension for files using ESM imports. Update `tsconfig.json` `module` option if necessary.
Review existing uses of `zip` to ensure compatibility with the .NET-standard behavior. If the old behavior is needed, implement custom logic.
It is recommended to use TypeScript 5.6.X or newer. Ensure your `tsconfig.json` has `"target": "es2022"` and `"lib": ["es2022"]`.
Upgrade your Node.js environment to version 17 or higher. Use a Node.js version manager like `nvm` to easily switch versions.
Change `const myLinq = require('linq-to-typescript');` to `import * as myLinq from 'linq-to-typescript';` or `import { from } from 'linq-to-typescript';`. Ensure `"type": "module"` is set in your `package.json`.Verify that `import { from } from 'linq-to-typescript';` is used and that your build tools (e.g., Webpack, Rollup, Babel) are configured to correctly handle ESM. Check `tsconfig.json` for `moduleResolution` and `module` settings.Ensure your `tsconfig.json` includes `"target": "es2022"` and `"lib": ["es2022"]`. Also, verify that `moduleResolution` is set appropriately, e.g., `"nodenext"` or `"bundler"` for modern Node.js environments.
Ensure that `await` is used before calling methods on `IAsyncEnumerable` or `IParallelEnumerable`. If using native extensions, confirm `initializeLinq()` has been called globally before methods are invoked.
No dependency data recorded yet.
No traffic data recorded yet.