{"id":13469733,"url":"https://github.com/tomi/fromfrom","last_synced_at":"2025-04-12T16:38:22.767Z","repository":{"id":34070263,"uuid":"165733308","full_name":"tomi/fromfrom","owner":"tomi","description":"A JS library written in TS to transform sequences of data from format to another","archived":false,"fork":false,"pushed_at":"2023-03-02T03:16:34.000Z","size":12907,"stargazers_count":479,"open_issues_count":38,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T17:13:13.536Z","etag":null,"topics":["collection","linq","sequence","transform","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tomi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-14T20:53:10.000Z","updated_at":"2024-10-22T11:12:52.000Z","dependencies_parsed_at":"2024-01-13T17:12:13.252Z","dependency_job_id":"af58b83c-a19c-40f3-b54f-b63cf0fb2ac8","html_url":"https://github.com/tomi/fromfrom","commit_stats":{"total_commits":166,"total_committers":13,"mean_commits":12.76923076923077,"dds":0.5542168674698795,"last_synced_commit":"6686f203f657d1ab1e1d00c963bc747722f5a36d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi%2Ffromfrom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi%2Ffromfrom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi%2Ffromfrom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomi%2Ffromfrom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomi","download_url":"https://codeload.github.com/tomi/fromfrom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248597754,"owners_count":21130939,"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":["collection","linq","sequence","transform","typescript"],"created_at":"2024-07-31T15:01:53.412Z","updated_at":"2025-04-12T16:38:22.742Z","avatar_url":"https://github.com/tomi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# fromfrom\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/tomi/fromfrom.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.com/tomi/fromfrom.svg?branch=master)](https://travis-ci.com/tomi/fromfrom)\n[![Coveralls](https://img.shields.io/coveralls/tomi/fromfrom.svg)](https://coveralls.io/github/tomi/fromfrom)\n[![Dev Dependencies](https://david-dm.org/tomi/fromfrom/dev-status.svg)](https://david-dm.org/tomi/fromfrom?type=dev)\n[![Sponsored](https://img.shields.io/badge/chilicorn-sponsored-brightgreen.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAMAAADjyg5GAAABqlBMVEUAAAAzmTM3pEn%2FSTGhVSY4ZD43STdOXk5lSGAyhz41iz8xkz2HUCWFFhTFFRUzZDvbIB00Zzoyfj9zlHY0ZzmMfY0ydT0zjj92l3qjeR3dNSkoZp4ykEAzjT8ylUBlgj0yiT0ymECkwKjWqAyjuqcghpUykD%2BUQCKoQyAHb%2BgylkAyl0EynkEzmkA0mUA3mj86oUg7oUo8n0k%2FS%2Bw%2Fo0xBnE5BpU9Br0ZKo1ZLmFZOjEhesGljuzllqW50tH14aS14qm17mX9%2Bx4GAgUCEx02JySqOvpSXvI%2BYvp2orqmpzeGrQh%2Bsr6yssa2ttK6v0bKxMBy01bm4zLu5yry7yb29x77BzMPCxsLEzMXFxsXGx8fI3PLJ08vKysrKy8rL2s3MzczOH8LR0dHW19bX19fZ2dna2trc3Nzd3d3d3t3f39%2FgtZTg4ODi4uLj4%2BPlGxLl5eXm5ubnRzPn5%2Bfo6Ojp6enqfmzq6urr6%2Bvt7e3t7u3uDwvugwbu7u7v6Obv8fDz8%2FP09PT2igP29vb4%2BPj6y376%2Bu%2F7%2Bfv9%2Ff39%2Fv3%2BkAH%2FAwf%2FtwD%2F9wCyh1KfAAAAKXRSTlMABQ4VGykqLjVCTVNgdXuHj5Kaq62vt77ExNPX2%2Bju8vX6%2Bvr7%2FP7%2B%2FiiUMfUAAADTSURBVAjXBcFRTsIwHAfgX%2FtvOyjdYDUsRkFjTIwkPvjiOTyX9%2FAIJt7BF570BopEdHOOstHS%2BX0s439RGwnfuB5gSFOZAgDqjQOBivtGkCc7j%2B2e8XNzefWSu%2BsZUD1QfoTq0y6mZsUSvIkRoGYnHu6Yc63pDCjiSNE2kYLdCUAWVmK4zsxzO%2BQQFxNs5b479NHXopkbWX9U3PAwWAVSY%2FpZf1udQ7rfUpQ1CzurDPpwo16Ff2cMWjuFHX9qCV0Y0Ok4Jvh63IABUNnktl%2B6sgP%2BARIxSrT%2FMhLlAAAAAElFTkSuQmCC)](http://spiceprogram.org/oss-sponsorship)\n[![All Contributors](https://img.shields.io/badge/all_contributors-5-orange.svg?style=flat-square)](#contributors)\n\nfromfrom is a [LINQ](https://en.wikipedia.org/wiki/Language_Integrated_Query) inspired library to transform sequences of data.\n\n## Installation\n\n```bash\nnpm install --save fromfrom\n```\n\n## Documentation\n\nFind it [here](https://tomi.github.io/fromfrom/).\n\n## Usage\n\nThe library exports only a single function, [`from`](https://tomi.github.io/fromfrom/api/index.html#from). [`from`](https://tomi.github.io/fromfrom/api/index.html#from) wraps the given source data into a [`Sequence`](https://tomi.github.io/fromfrom/api/classes/sequence.html). [`Sequence`](https://tomi.github.io/fromfrom/api/classes/sequence.html) has a wide range of chainable methods to operate and transform the sequence. The sequence can then be converted into a JS type.\n\nFor example\n\n```ts\nimport { from } from \"fromfrom\";\n\n// Transform an array of users\nconst users = [\n  { id: 1, name: \"John\", age: 31, active: true },\n  { id: 2, name: \"Jane\", age: 32, active: false },\n  { id: 3, name: \"Luke\", age: 33, active: false },\n  { id: 4, name: \"Mary\", age: 34, active: true },\n];\n\nfrom(users)\n  .filter(user =\u003e user.active)\n  .sortByDescending(user =\u003e user.age)\n  .toArray();\n// Returns\n// [\n//   { id: 4, name: \"Mary\", age: 34, active: true },\n//   { id: 1, name: \"John\", age: 31, active: true }\n// ]\n```\n\n## Features\n\n- **Familiar method names** - Even though it's LINQ inspired, uses familiar method names from JS.\n- **Supports all main JS types** - Works with arrays, objects, maps, sets, and objects that implement the [iterable protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).\n- **No dependencies** - Guarantees small size.\n- **Type safe** - Written in TypeScript. Type definitions included.\n- **Deferred execution** - The execution of the sequence is deferred until you begin consuming the sequence.\n- **Fully tested** - 100% test coverage.\n\n## How does it work\n\nSee \"how does it work\" section from the initial [release blog post](https://github.com/tomi/fromfrom/wiki/Announcing-fromfrom#how-does-it-work).\n\n## Development\n\n### NPM scripts\n\n- `npm t`: Run test suite\n- `npm start`: Run `npm run build` in watch mode\n- `npm run test:watch`: Run test suite in [interactive watch mode](http://facebook.github.io/jest/docs/cli.html#watch)\n- `npm run test:prod`: Run linting and generate coverage\n- `npm run build`: Generate bundles and typings, create docs\n- `npm run lint`: Lints code\n- `npm run commit`: Commit using conventional commit style ([husky](https://github.com/typicode/husky) will tell you to use it if you haven't :wink:)\n\n## Acknowledgement\n\nMade with :heart: by [@TomiTurtiainen](https://twitter.com/TomiTurtiainen).\n\nThis project is a grateful recipient of the [Futurice Open Source sponsorship program](https://spiceprogram.org). :heart:\n\nForked from [TypeScript library starter](https://github.com/alexjoverm/typescript-library-starter)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/tomi\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/10324676?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTomi Turtiainen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tomi/fromfrom/commits?author=tomi\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/tomi/fromfrom/commits?author=tomi\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#infra-tomi\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/tomi/fromfrom/commits?author=tomi\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jtenner\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/3761339?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ejtenner\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tomi/fromfrom/commits?author=jtenner\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/tomi/fromfrom/commits?author=jtenner\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/tomi/fromfrom/commits?author=jtenner\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://vaaralav.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/8571541?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eVille Vaarala\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-vaaralav\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dogoku\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/761999?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTheo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tomi/fromfrom/commits?author=dogoku\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/hollannikas\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/9109662?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRudolf Poels\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tomi/fromfrom/commits?author=hollannikas\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/andrew-w-ross\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/14924726?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndrew Ross\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/tomi/fromfrom/issues?q=author%3Aandrew-w-ross\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomi%2Ffromfrom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomi%2Ffromfrom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomi%2Ffromfrom/lists"}