# linqts

> LinQ + TypeScript

Latest version **3.3.0** (published 2026-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install linqts
pnpm add linqts
yarn add linqts
bun add linqts
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.3.0 |
| Published | 2026-07-02 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 194.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 881 |
| Author | Flavio Corpa |
| Maintainers | kutyel |
| Keywords | linq, typescript |

## Links

- npm: https://www.npmjs.com/package/linqts
- Repository: https://github.com/kutyel/linq.ts
- Homepage: https://github.com/kutyel/linq.ts#readme
- Issues: https://github.com/kutyel/linq.ts/issues
- npm.io page: https://npm.io/package/linqts

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 3.3.0 (latest) — 2026-07-02
- 3.2.0 — 2025-09-09
- 3.1.0 — 2025-07-23
- 3.0.0 — 2025-07-21
- 2.0.0 — 2024-08-01
- 1.15.0 — 2023-05-16
- 1.14.4 — 2021-01-12
- 1.14.3 — 2020-08-19
- 1.14.2 — 2020-06-05
- 1.14.1 — 2020-06-05
- 1.14.0 — 2020-06-01
- 1.13.0 — 2020-05-08
- 1.12.6 — 2019-08-02
- 1.12.5 — 2019-06-20
- 1.12.4 — 2019-06-12
- … 47 more at https://npm.io/package/linqts/versions

## README

# LinQ for TypeScript

[![Build](https://github.com/kutyel/linq.ts/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/kutyel/linq.ts/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/kutyel/linq.ts/badge.svg?branch=master)](https://coveralls.io/github/kutyel/linq.ts?branch=master)
[![Downloads](https://img.shields.io/npm/dm/linqts.svg)](https://npmjs.com/package/linqts)
[![Version](https://img.shields.io/npm/v/linqts.svg)](https://npmjs.com/package/linqts)
[![Sponsors](https://img.shields.io/github/sponsors/kutyel)](https://github.com/sponsors/kutyel)
[![linqts](https://raw.githubusercontent.com/kutyel/linq/master/linqts.png)](http://www.typescriptlang.org)

## Install

```sh
$ npm i linqts
```

## Usage

```typescript
import { List } from 'linqts';

const arr = new List<number>([1, 2, 3, 4, 5])
  .Where(x => x > 3)
  .Select(y => y * 2)
  .ToArray(); // > [8, 10]

const query = people.Join(pets,
  person => person,
  pet => pet.Owner,
  (person, pet) =>
    ({ OwnerName: person.Name, Pet: pet.Name }));
```

## Extending `List<T>`

Type-preserving operators (`Where`, `Take`, `Skip`, `Distinct`, `Concat`, `Reverse`, etc.) return the type of the receiver, so subclasses keep their derived type and fluent chaining just works:

```typescript
class UserList extends List<User> {
  public Active(): this {
    return this.Where(user => user.Active);
  }
}

const users = new UserList(seedUsers);
users.Active().Take(10); // still a UserList ✨
```

New instances are created through a protected `cloneWith(elements: T[]): this` factory that calls the receiver's constructor with the elements array. If your subclass constructor has a different signature, override it:

```typescript
class TaggedList extends List<number> {
  constructor(public Tag: string, elements: number[] = []) {
    super(elements);
  }

  protected cloneWith(elements: number[]): this {
    return new TaggedList(this.Tag, elements) as this;
  }
}
```

Projection operators that change the element type (`Select`, `SelectMany`, `Cast`, `OfType`, `GroupBy`, `Join`, `Zip`...) still return a plain `List<TOut>`, since a derived list of a different element type would be meaningless.

## Demo

![linqts.gif](https://raw.githubusercontent.com/kutyel/linq/master/linqts.gif)

## Documentation

If you do not know LinQ or just want to remember what is all about, have a look at the [docs](http://kutyel.github.io/linq.ts/docs/classes/list/index.html).

## Tests

```sh
$ npm t
```

Powered by [AVA](https://github.com/sindresorhus/ava).

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="http://flaviocorpa.com"><img src="https://avatars0.githubusercontent.com/u/5127501?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Flavio Corpa</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=kutyel" title="Code">💻</a> <a href="#question-kutyel" title="Answering Questions">💬</a> <a href="https://github.com/kutyel/linq.ts/commits?author=kutyel" title="Documentation">📖</a> <a href="https://github.com/kutyel/linq.ts/pulls?q=is%3Apr+reviewed-by%3Akutyel" title="Reviewed Pull Requests">👀</a></td>
    <td align="center"><a href="https://github.com/Kurtz1993"><img src="https://avatars1.githubusercontent.com/u/5412470?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Luis Rogelio Hernández López</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=Kurtz1993" title="Code">💻</a> <a href="#tool-Kurtz1993" title="Tools">🔧</a></td>
    <td align="center"><a href="https://github.com/zskovacs"><img src="https://avatars3.githubusercontent.com/u/20083522?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Zsolt Kovács</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=zskovacs" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/abbasmhd"><img src="https://avatars2.githubusercontent.com/u/1510389?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Mo Abbas</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=abbasmhd" title="Code">💻</a></td>
    <td align="center"><a href="https://euipo.europa.eu/ohimportal/404"><img src="https://avatars3.githubusercontent.com/u/13154847?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Julián Salgado Napolitano</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=keropodium" title="Code">💻</a> <a href="#tool-keropodium" title="Tools">🔧</a></td>
    <td align="center"><a href="https://github.com/mstrzoda"><img src="https://avatars0.githubusercontent.com/u/22657637?v=3?s=100" width="100px;" alt=""/><br /><sub><b>mstrzoda</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=mstrzoda" title="Code">💻</a> <a href="https://github.com/kutyel/linq.ts/issues?q=author%3Amstrzoda" title="Bug reports">🐛</a> <a href="https://github.com/kutyel/linq.ts/commits?author=mstrzoda" title="Tests">⚠️</a></td>
    <td align="center"><a href="https://github.com/Zoxive"><img src="https://avatars0.githubusercontent.com/u/124676?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Kyle Wascher</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=Zoxive" title="Tests">⚠️</a></td>
  </tr>
  <tr>
    <td align="center"><a href="https://github.com/jamesrichford"><img src="https://avatars1.githubusercontent.com/u/8244919?v=3?s=100" width="100px;" alt=""/><br /><sub><b>James Richford</b></sub></a><br /><a href="#tool-jamesrichford" title="Tools">🔧</a></td>
    <td align="center"><a href="https://in.linkedin.com/in/natarajanganapathi"><img src="https://avatars1.githubusercontent.com/u/9244766?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Natarajan Ganapathi</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=natarajanmca11" title="Code">💻</a> <a href="#tool-natarajanmca11" title="Tools">🔧</a></td>
    <td align="center"><a href="https://github.com/jbrekle"><img src="https://avatars0.githubusercontent.com/u/797614?v=3?s=100" width="100px;" alt=""/><br /><sub><b>Jonas Brekle</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=jbrekle" title="Code">💻</a> <a href="https://github.com/kutyel/linq.ts/issues?q=author%3Ajbrekle" title="Bug reports">🐛</a></td>
    <td align="center"><a href="https://github.com/grofit"><img src="https://avatars3.githubusercontent.com/u/927201?v=4?s=100" width="100px;" alt=""/><br /><sub><b>LP</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=grofit" title="Code">💻</a> <a href="https://github.com/kutyel/linq.ts/commits?author=grofit" title="Tests">⚠️</a></td>
    <td align="center"><a href="https://github.com/asierferro"><img src="https://avatars3.githubusercontent.com/u/1768777?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Asier Ferro</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=asierferro" title="Code">💻</a> <a href="#tool-asierferro" title="Tools">🔧</a></td>
    <td align="center"><a href="https://github.com/marlon-tucker"><img src="https://avatars2.githubusercontent.com/u/1166915?v=4?s=100" width="100px;" alt=""/><br /><sub><b>marlon-tucker</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=marlon-tucker" title="Code">💻</a> <a href="#tool-marlon-tucker" title="Tools">🔧</a> <a href="#platform-marlon-tucker" title="Packaging/porting to new platform">📦</a></td>
    <td align="center"><a href="https://github.com/SkeletonSkelettron"><img src="https://avatars2.githubusercontent.com/u/26940527?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Misha Sulikashvili</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=SkeletonSkelettron" title="Code">💻</a> <a href="https://github.com/kutyel/linq.ts/commits?author=SkeletonSkelettron" title="Tests">⚠️</a></td>
  </tr>
  <tr>
    <td align="center"><a href="https://github.com/mrsauravsahu"><img src="https://avatars.githubusercontent.com/u/9134050?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Saurav Sahu</b></sub></a><br /><a href="#infra-mrsauravsahu" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
    <td align="center"><a href="https://github.com/typescriptbob"><img src="https://avatars.githubusercontent.com/u/57693517?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bob Cook</b></sub></a><br /><a href="#financial-typescriptbob" title="Financial">💵</a></td>
    <td align="center"><a href="http://www.adrienrichard.com/"><img src="https://avatars.githubusercontent.com/u/25491408?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adrien</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=Mrgove10" title="Code">💻</a></td>
    <td align="center"><a href="https://github.com/mobilebilly"><img src="https://avatars.githubusercontent.com/u/795601?v=4?s=100" width="100px;" alt=""/><br /><sub><b>mobilebilly</b></sub></a><br /><a href="https://github.com/kutyel/linq.ts/commits?author=mobilebilly" title="Code">💻</a></td>
  </tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## License

MIT © [Flavio Corpa](http://flaviocorpa.com)

---
_Source: https://npm.io/package/linqts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
