{"id":17760656,"url":"https://github.com/mbasso/ienumerable","last_synced_at":"2025-07-20T14:33:24.715Z","repository":{"id":47854826,"uuid":"66495192","full_name":"mbasso/ienumerable","owner":"mbasso","description":"Deep immutable, Lightweight Enumerable with superpowers","archived":false,"fork":false,"pushed_at":"2022-12-06T02:25:45.000Z","size":1566,"stargazers_count":66,"open_issues_count":8,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-09T11:05:20.794Z","etag":null,"topics":["array","immutable","javascript","linq","list"],"latest_commit_sha":null,"homepage":"https://ienumerable.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbasso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-24T19:54:57.000Z","updated_at":"2024-04-20T16:30:00.000Z","dependencies_parsed_at":"2023-01-24T08:15:55.780Z","dependency_job_id":null,"html_url":"https://github.com/mbasso/ienumerable","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mbasso/ienumerable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fienumerable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fienumerable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fienumerable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fienumerable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbasso","download_url":"https://codeload.github.com/mbasso/ienumerable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fienumerable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266140398,"owners_count":23882667,"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":["array","immutable","javascript","linq","list"],"created_at":"2024-10-26T19:07:19.555Z","updated_at":"2025-07-20T14:33:24.692Z","avatar_url":"https://github.com/mbasso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IEnumerable\n\n[![Build Status](https://travis-ci.org/mbasso/ienumerable.svg?branch=master)](https://travis-ci.org/mbasso/ienumerable)\n[![npm version](https://img.shields.io/npm/v/ienumerable.svg)](https://www.npmjs.com/package/ienumerable)\n[![npm downloads](https://img.shields.io/npm/dm/ienumerable.svg?maxAge=2592000)](https://www.npmjs.com/package/ienumerable)\n[![Coverage Status](https://coveralls.io/repos/github/mbasso/ienumerable/badge.svg?branch=master)](https://coveralls.io/github/mbasso/ienumerable?branch=master)\n[![Join the chat at https://gitter.im/mbasso/ienumerable](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mbasso/ienumerable?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\u003e Deep immutable, Lightweight Enumerable with superpowers\n\n- - -\n\n**Attention - there are some important differences between IEnumerable and other existing LINQ implementations. You can find an example [here](https://jsbin.com/figicok/edit?js,console) and IEnumerable features explanation [here](http://ienumerable.js.org/docs/introduction/Features.html).**\n\n- - -\n\nIEnumerable is a library that allows you to create deeply immutable collections and query them with a Linq syntax. IEnumerable infact, is born from the idea to bring [Linq](https://msdn.microsoft.com/en-us/library/bb397926.aspx) in JavaScript environment. Linq is a fantastic technique to query data and JavaScript should have it. In addition, we want to maintain the advantages of [Immutable Js](https://facebook.github.io/immutable-js/) and improve them. In IEnumerable, not only the collection is immutable but also its content. Every method will return a new Enumerable and a new copy of its content.\nIEnumerable should not be confused with [Rx](http://reactivex.io/) due to its syntax, IEnumerable and Rx are two different things that achieve different purposes. [Here](http://stackoverflow.com/questions/17082255/when-to-use-ienumerable-vs-iobservable) is an interesting question about that.\n\n## Installation\n\nYou can install IEnumerable using [npm](https://www.npmjs.com/package/ienumerable):\n\n```bash\nnpm install --save ienumerable\n```\n\nIf you aren't using npm in your project, you can include IEnumerable using UMD build in the dist folder with `\u003cscript\u003e` tag.\n\n## Usage\n\nIEnumerable exports only one class to do its work. A complete guide about usage can be found [here](https://mbasso.github.io/ienumerable/docs/api/index.html).\nHowever, here is the gist:\n\n```js\nimport Enumerable from 'ienumerable';\n\n// represents an Address\nclass Address {\n  constructor(city, state, ...params) {\n    this.city = city;\n    this.state = state;\n  }\n}\n\n// List of addresses, with:\n// 8 lorem with state = 'MA'\n// 6 foo with state = 'MA'\n// 4 bar with state = 'MA'\n// other Addresses\nconst AddressArray = [\n  new Address('foo', 'MA'),\n  new Address('foo', 'MA'),\n  new Address('ipsum', 'MA'),\n  new Address('foo', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('bar', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('bar', 'MA'),\n  new Address('foo', 'MA'),\n  new Address('foo', 'MA'),\n  new Address('ipsum', 'MA'),\n  new Address('foo', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('bar', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('bar', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('lorem', 'MA'),\n  new Address('foo', 'lorem'),\n  new Address('foo', 'lorem'),\n  new Address('ipsum', 'loremlorem'),\n  new Address('foo', 'lorem'),\n  new Address('lorem', 'lorem'),\n  new Address('bar', 'lorem'),\n  new Address('lorem', 'lorem'),\n  new Address('bar', 'lorem'),\n];\n\n/*\nselect City, CNT=Count(1)\nFrom Address\nWhere State = 'MA'\nGroup By City\nHaving Count(1)\u003e5\n*/\n\n// translating that select using an Enumerable\nEnumerable\n        .from(AddressArray)\n        .where(x =\u003e x.state === 'MA')\n        .groupBy(\r\n          x =\u003e x.city,\r\n          x =\u003e x,\r\n          (key, items) =\u003e ({\r\n            key,\r\n            count: items.count(),\r\n          })\r\n        )\n        .having(x =\u003e x.count \u003e 5)\n        .select(x =\u003e {\n          city: x.key,\n          count: x.count,\n        })\n        .toArray();\n// [\n//   {\n//     city: 'lorem',\n//     count: 8,\n//   }, {\n//     city: 'foo',\n//     count: 6,\n//   }\n// ]\n```\n\n## Documentation\n\n* [Introduction](https://mbasso.github.io/ienumerable/docs/introduction/index.html)\n* [Glossary](https://mbasso.github.io/ienumerable/docs/Glossary.html)\n* [API Reference](https://mbasso.github.io/ienumerable/docs/api/index.html)\n\n## Examples\n\nYou can check for examples on the official page, [here](https://mbasso.github.io/ienumerable/docs/introduction/Examples.html).\n\n# Chat\n\nThis project has an official chat channel on [gitter](https://gitter.im/).\nThis is the right place to talk about IEnumerable with us and others developers.\nFeel free to participate.\n\nJoin chat [here](https://gitter.im/mbasso/ienumerable).\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).  \nEvery release, along with the migration instructions, is documented on the Github [Releases](https://github.com/mbasso/ienumerable/releases) page.\n\n## Authors\n**Matteo Basso**\n- [github/mbasso](https://github.com/mbasso)\n- [@Teo_Basso](https://twitter.com/Teo_Basso)\n\n## Copyright and License\nCopyright (c) 2016, Matteo Basso.\n\nIEnumerable source code is licensed under the [MIT License](https://github.com/mbasso/ienumerable/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Fienumerable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbasso%2Fienumerable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Fienumerable/lists"}