{"id":13451965,"url":"https://github.com/Darkhogg/polyethylene","last_synced_at":"2025-03-23T19:33:21.481Z","repository":{"id":33688754,"uuid":"143769021","full_name":"Darkhogg/polyethylene","owner":"Darkhogg","description":"easy manipulation of iterables and async itrerables ","archived":false,"fork":false,"pushed_at":"2024-07-18T14:09:45.000Z","size":780,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-02T17:45:42.916Z","etag":null,"topics":["async-iterables","functional-programming","iterables","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/Darkhogg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-08-06T18:44:25.000Z","updated_at":"2024-03-06T18:03:28.000Z","dependencies_parsed_at":"2023-01-15T02:04:18.905Z","dependency_job_id":"75303e96-f09e-45aa-bb3f-75e153627ab5","html_url":"https://github.com/Darkhogg/polyethylene","commit_stats":{"total_commits":81,"total_committers":4,"mean_commits":20.25,"dds":0.0864197530864198,"last_synced_commit":"22bb101ff26d74031c92ee344933b93f1bf32d77"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkhogg%2Fpolyethylene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkhogg%2Fpolyethylene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkhogg%2Fpolyethylene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkhogg%2Fpolyethylene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darkhogg","download_url":"https://codeload.github.com/Darkhogg/polyethylene/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221900705,"owners_count":16898986,"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":["async-iterables","functional-programming","iterables","typescript"],"created_at":"2024-07-31T07:01:08.551Z","updated_at":"2024-10-28T18:30:26.090Z","avatar_url":"https://github.com/Darkhogg.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Polyethylene\n\nPolyethylene is a wrapping layer around iterators and async iterators that lets you chain\nfunctional operators in a similar way you do with arrays but without the memory overhead or having\nto wait for an asynchronous iteration to end.\n\n[![Version](https://img.shields.io/npm/v/polyethylene.svg)](https://www.npmjs.com/package/polyethylene)\n[![Tests](https://img.shields.io/github/actions/workflow/status/darkhogg/polyethylene/test.yaml?branch=main)](https://github.com/Darkhogg/polyethylene/actions/workflows/test.yaml?query=branch%3Amain)\n[![](https://img.shields.io/github/license/Darkhogg/polyethylene)][license]\n\n\n## Basic Usage\n\nThe default export of `polyethylene` (named `Poly` throughout the documentation) is the main entry point.\nYou would typically create an \"augmented\" iterable object using `Poly.asyncFrom` or `Poly.syncFrom`, then you start\ncalling _transform methods_ like `.map`, `.filter`, etc. in the returned object, ending with a _leaf method_ like\n`.reduce` or `.forEach`.\n\nIn this way, polyethylene objects behave very similarly to `Array`s, but they are fundamentally different because they\ndon't store their elements anywhere, instead processing them one by one.\n\nThe following is a very simple, fictitious example of using polyethylene:\n\n\n```typescript\nimport Poly from 'polyethylene';\nimport {findUsers, findUserPosts} from 'some-api-lib'\n\n// Print the first 10 posts of each user\nawait Poly.asyncFrom(findUsers())\n  .flatMap(user =\u003e Poly.asyncFrom(findUserPosts(user)).take(10))\n  .forEach(post =\u003e console.log(post));\n```\n\n### CommonJS\n\nThis package is designed as an ECMAScript Module from the get go, but since 2.1.0 a CommonJS version is provided.\n\nAll named exports are supported, but the default export must be accessed via the `default` or `Poly` exports:\n\n```javascript\nconst Poly = require('polyethylene').default\n```\n```javascript\nconst {Poly} = require('polyethylene')\n```\n\n\n## Full Documentation\n\nSee the [API Documentation](./docs/polyethylene.md).\n\n## License\n\nPolyethylene is released under the [MIT License][license]\n\n  [license]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarkhogg%2Fpolyethylene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDarkhogg%2Fpolyethylene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDarkhogg%2Fpolyethylene/lists"}