https://github.com/hexlet-components/js-linq
https://github.com/hexlet-components/js-linq
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet-components/js-linq
- Owner: hexlet-components
- Created: 2016-07-03T16:17:23.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T07:31:03.000Z (almost 2 years ago)
- Last Synced: 2025-10-28T00:32:38.712Z (8 months ago)
- Language: JavaScript
- Size: 1.18 MB
- Stars: 0
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-linq
[](https://github.com/hexlet-components/js-linq/actions)
[](https://codeclimate.com/github/hexlet-components/js-linq)
## Install
```sh
npm install @hexlet/linq
```
## Usage example
```javascript
import HexletLinq from '@hexlet/linq';
const cars = [
{ brand: 'bmw', model: 'm5', year: 2014 },
{ brand: 'bmw', model: 'm4', year: 2013 },
{ brand: 'kia', model: 'sorento', year: 2014 },
{ brand: 'kia', model: 'rio', year: 2010 },
{ brand: 'kia', model: 'sportage', year: 2012 },
];
const coll = HexletLinq.from(cars);
const result = coll.orderBy(car => car.year, 'desc')
.where(car => car.brand === 'kia')
.select(car => car.model);
result.toArray();
// ['sorento', 'sportage', 'rio']
```
For more information, see the [Full Documentation](https://github.com/hexlet-components/js-linq/tree/master/docs)
--
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-linq)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-linq).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).