{"id":18252072,"url":"https://github.com/eniks/linq","last_synced_at":"2025-04-07T10:25:01.509Z","repository":{"id":32992417,"uuid":"36621225","full_name":"ENikS/LINQ","owner":"ENikS","description":"TypeScript Implementation of Language-Integrated Query (LINQ) (ECMAScript 2015)","archived":false,"fork":false,"pushed_at":"2021-04-12T17:58:38.000Z","size":786,"stargazers_count":115,"open_issues_count":0,"forks_count":26,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-31T07:08:34.013Z","etag":null,"topics":["angular","ecmascript2015","iterables","javascript","linq","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ENikS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-31T20:42:18.000Z","updated_at":"2023-12-28T13:35:18.000Z","dependencies_parsed_at":"2022-08-24T22:11:43.227Z","dependency_job_id":null,"html_url":"https://github.com/ENikS/LINQ","commit_stats":null,"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ENikS%2FLINQ","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ENikS%2FLINQ/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ENikS%2FLINQ/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ENikS%2FLINQ/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ENikS","download_url":"https://codeload.github.com/ENikS/LINQ/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247633294,"owners_count":20970300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","ecmascript2015","iterables","javascript","linq","typescript"],"created_at":"2024-11-05T09:49:57.348Z","updated_at":"2025-04-07T10:25:01.485Z","avatar_url":"https://github.com/ENikS.png","language":"TypeScript","readme":"[![Build Status](https://travis-ci.org/ENikS/LINQ.svg?branch=master)](https://travis-ci.org/ENikS/LINQ) \n[![Coverage Status](https://coveralls.io/repos/github/ENikS/LINQ/badge.svg?branch=master)](https://coveralls.io/github/ENikS/LINQ?branch=master)\n[![Dependency Status](https://dependencyci.com/github/ENikS/LINQ/badge)](https://dependencyci.com/github/ENikS/LINQ)\n[![Greenkeeper badge](https://badges.greenkeeper.io/ENikS/LINQ.svg)](https://greenkeeper.io/)\n[![npm version](https://badge.fury.io/js/linq-es2015.svg)](https://badge.fury.io/js/linq-es2015)\n[![Downloads](https://img.shields.io/npm/dm/linq-es2015.svg)](https://www.npmjs.com/package/linq-es2015)\n[![License](https://img.shields.io/badge/license-apache%202.0-60C060.svg)](https://github.com/ENikS/LINQ/blob/master/LICENSE)\n\nThe library is a continuous effort to implement LINQ using latest features of TypeScript and JavaScript languages (For [ES5](http://www.ecma-international.org/ecma-262/5.1/) compatible library look at [linq-es5](https://github.com/ENikS/LINQ/tree/linq-es5) branch). The library is implemented in TypeScript and transpiled into JavaScript. It is distributed as a native module. It utilizes latest [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/) language specification:  [Iterables](http://www.ecma-international.org/ecma-262/6.0/#sec-iterable-interface) ([ [System.iterator] ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)), generators ([function*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)), [for of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loops. \u003cbr/\u003e All relevant methods are implemented with [deferred execution](https://blogs.msdn.microsoft.com/charlie/2007/12/10/linq-and-deferred-execution/) so no unnecessary iterations are performed. \nThe code is backwards compatible with [linq-es5](https://github.com/ENikS/LINQ/tree/linq-es5) and [C#](https://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx) implementations.\n\n## Using in Node\n\nInstall module with this command:\n```\nnpm install linq-es2015 --save\n```\nOnce installed it could be loaded and used like this:\n```javascript\nimport * as Enumerable from \"linq-es2015\"; \n\nvar count =  Enumerable.asEnumerable( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )\n                       .Where(a =\u003e a % 2 == 1)\n                       .Count()\n\nvar iterable = Enumerable.asEnumerable(people)\n                         .GroupJoin(pets,\n                                    person =\u003e person, \n                                    pet =\u003e pet.Owner,\n                                    (person, petCollection) =\u003e {\n                                        return {\n                                            Owner: person.Name,\n                                            Pets: asEnumerable(petCollection)\n                                                 .Select(pet=\u003e pet.Name)\n                                                 .ToArray()\n                                        };\n                                    });\n\n```\n[[See Example](https://tonicdev.com/eniks/using-linq)]  \n\n\n## Using in browser\n[Browserified](//browserify.org/) \"[standalone](//github.com/substack/node-browserify#usage)\" [UMD](//github.com/umdjs/umd) module is located in ```/dist``` directory and could be accessed through [NPM CDN service](//unpkg.com). Both [linq.js](//unpkg.com/linq-es2015/dist/linq.js) and [linq.min.js](//unpkg.com/linq-es2015/dist/linq.min.js) are available. \nModule is loaded with ```\u003cscript\u003e``` element:\n```javascript\n\u003cscript type=\"text/javascript\" src=\"//unpkg.com/linq-es2015/dist/linq.min.js\"\u003e\u003c/script\u003e\n```\nLoading this script creates ```Enumerable``` global variable. You can use it to perform LINQ queries:\n```javascript\nvar count =  Enumerable.asEnumerable( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )\n                       .Where(a =\u003e a % 2 == 1)\n                       .Count()\n```\n[[See Example](//jsfiddle.net/ENikS/pyvjcfa0/)]\n\n## Using in Angular 2\nThe same package could be used on a server as well as on the client. You have to install module as usual:\n```\nnpm install linq-es2015 --save\n```\nOpen ```app.components.html``` file and add element to hold calculated value:\n```javascript\n\u003ch1\u003e{{title}}\u003c/h1\u003e\n\u003cdiv\u003eCount - {{count}}\u003c/div\u003e\n```\nand finally import ```linq-es2015``` in app.component.ts and do some calculations:\n```javascript\nimport { Component } from '@angular/core';\nimport { asEnumerable } from 'linq-es2015';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\n\nexport class AppComponent {\n  title = 'app works!';\n  count: number;\n\n    constructor(){\n      this.count = asEnumerable([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).Where(a =\u003e a % 2 == 1)\n                                                                .Count();        \n    }\n}\n```\n[[See Example](https://github.com/ENikS/LINQ/tree/examples/Angular)]\n\n## Documentation\n*  [Library Reference](https://github.com/ENikS/LINQ/wiki)\n*  [LINQ (Language-Integrated Query)](https://msdn.microsoft.com/en-us/library/bb397926.aspx)\n*  [Original Documentation (C#)](https://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx)\n\n## [Example Projects](https://github.com/ENikS/LINQ/tree/examples)\n*  [Browser Example](https://jsfiddle.net/ENikS/pyvjcfa0/)\n*  [Node Example](https://tonicdev.com/eniks/using-linq)\n*  [Angular 2 Example](https://github.com/ENikS/LINQ/tree/examples/Angular)\n*  [Node Console Example](https://github.com/ENikS/LINQ/tree/examples/Node)\n*  [TypeScript/JavaScript Web Example](https://github.com/ENikS/LINQ/tree/examples/TypeScript)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feniks%2Flinq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feniks%2Flinq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feniks%2Flinq/lists"}