{"id":13990874,"url":"https://github.com/winterbe/sequency","last_synced_at":"2025-07-22T13:31:53.326Z","repository":{"id":24126093,"uuid":"99952115","full_name":"winterbe/sequency","owner":"winterbe","description":"⚡️ Type-safe functional sequences for processing iterable data","archived":false,"fork":false,"pushed_at":"2024-03-30T16:15:07.000Z","size":1823,"stargazers_count":346,"open_issues_count":6,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-09T13:17:55.893Z","etag":null,"topics":["collection","functional","javascript","sequence","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sequency","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/winterbe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-10T18:11:05.000Z","updated_at":"2024-08-02T13:49:07.000Z","dependencies_parsed_at":"2024-06-18T15:14:32.389Z","dependency_job_id":"57a8e7b1-c2dc-49cd-8880-2c46362339da","html_url":"https://github.com/winterbe/sequency","commit_stats":{"total_commits":147,"total_committers":2,"mean_commits":73.5,"dds":"0.020408163265306145","last_synced_commit":"948a7876229bba951ad2ac1c2c26ffdf91d7e41d"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fsequency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fsequency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fsequency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winterbe%2Fsequency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winterbe","download_url":"https://codeload.github.com/winterbe/sequency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227099040,"owners_count":17730698,"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","functional","javascript","sequence","typescript"],"created_at":"2024-08-09T13:03:26.559Z","updated_at":"2024-11-29T10:32:00.739Z","avatar_url":"https://github.com/winterbe.png","language":"TypeScript","readme":"# ![Sequencey](/sequency.png) [![Travic CI](https://travis-ci.org/winterbe/sequency.svg?branch=master)](https://travis-ci.org/winterbe/sequency)\n\n\u003e Type-safe functional sequences for processing iterable data in TypeScript and JavaScript.\n\n![Sequencey](/sequency.gif)\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003cstrong\u003e★★★ Like this project? \u003ca href=\"https://github.com/winterbe/sequency/stargazers\"\u003eLeave a star\u003c/a\u003e and \u003ca href=\"https://twitter.com/winterbe_\"\u003efollow on Twitter\u003c/a\u003e! Thanks. ★★★\u003c/strong\u003e\n\u003c/p\u003e\n\n## About Sequency\n\nSequency is a lightweight (**5 KB minified**), intensely tested (**200+ tests, 99% coverage**), type-safe functional programming library for processing iterable data such as arrays, sets and maps. It's written in TypeScript, compiles to ES5-compatible JavaScript and works in all current browsers and Node applications. The API is inspired by [Sequences](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/) from the programming language [Kotlin](https://kotlinlang.org/).\n\n\u003e [Try Sequency](https://npm.runkit.com/sequency) right in your browser.\n\n## Getting started\n\nDownload the [latest release](https://github.com/winterbe/sequency/releases) from GitHub or install Sequency from [NPM](https://www.npmjs.com/package/sequency):\n\n```bash\nnpm install --save sequency\n```\n\nAlternatively use Sequency from [CDN](https://unpkg.com/sequency/) by adding this to your HTML:\n\n```html\n\u003cscript src=\"https://unpkg.com/sequency\"\u003e\u003c/script\u003e\n```\n\n## How Sequency works\n\nSequency is centered around a single class called `Sequence` to process any kind of iterable data such as arrays, sets or maps. The API is inspired by [Kotlin](https://kotlinlang.org/) [Sequences](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/index.html). \n\nSequences can be created by utilizing one of the following functions:\n\n```js\nimport {\n    asSequence,\n    sequenceOf, \n    emptySequence, \n    range,\n    generateSequence,\n    extendSequence\n} from 'sequency';\n```\n\n- `sequenceOf` accepts one or many values and returns a new sequence.\n- `asSequence` accepts an iterable (e.g. an array, set or map) and returns a new sequence.\n- `emptySequence` returns a new empty sequence.\n- `range` returns as number sequence consisting of all numbers between `startInclusive` and `endExclusive`.\n- `generateSequence` returns a sequence generated from the given generator function.\n- `extendSequence` allows extending sequences with user-defined operations (see [example](https://github.com/winterbe/sequency/blob/ac3dbb0f212bb08783d970472c7a76dc921b60ba/test/extendSequence.test.ts)).\n\nEach `Sequence` provides a fluent functional API consisting of intermediate and terminal operations. Intermediate functions (e.g. `filter`, `map`, `sorted`) return a new sequence, thus enabling method chaining. Terminal functions (e.g. `toArray`, `groupBy`, `findLast`) return an arbitrary result. Detailed descriptions of all operations are available in the [API docs](https://winterbe.github.io/sequency/).\n\nSequences are **lazily evaluated** to avoid examining all of the input data when it's not necessary. Sequences always perform the minimal amount of operations to gain results. E.g. in a `filter - map - find` sequence both `map` and `find` are executed just one time before returning the single result.\n\n## [API documentation](https://winterbe.github.io/sequency/)\n\nSequency is fully documented via inline JSDoc comments. [The docs are also available online](https://winterbe.github.io/sequency/). When using an IDE like Intellij IDEA or Webstorm the docs are available inline right inside your editor.\n\n## Why Sequency?\n\nI've built Sequency because I'm using Kotlin for server-side code but for some reasons still use TypeScript and JavaScript for client-side browser code. I find that using the same APIs for collection processing both on client and server is a huge gain in productivity for me.\n\n## License\n\nMIT © [winterbe](https://twitter.com/winterbe_)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterbe%2Fsequency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinterbe%2Fsequency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinterbe%2Fsequency/lists"}