{"id":18901069,"url":"https://github.com/regular/pull-generate","last_synced_at":"2026-03-03T18:30:26.620Z","repository":{"id":66061302,"uuid":"41964456","full_name":"regular/pull-generate","owner":"regular","description":"pull-stream source that produces data on state transitions","archived":false,"fork":false,"pushed_at":"2015-09-09T14:18:23.000Z","size":168,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T12:48:10.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/regular.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-09-05T14:44:06.000Z","updated_at":"2018-03-12T16:23:49.000Z","dependencies_parsed_at":"2023-02-19T21:55:33.065Z","dependency_job_id":null,"html_url":"https://github.com/regular/pull-generate","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Fpull-generate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Fpull-generate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Fpull-generate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regular%2Fpull-generate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regular","download_url":"https://codeload.github.com/regular/pull-generate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239885979,"owners_count":19713402,"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":[],"created_at":"2024-11-08T08:55:03.753Z","updated_at":"2026-03-03T18:30:26.549Z","avatar_url":"https://github.com/regular.png","language":"JavaScript","readme":"# pull-generate\nA [pull-stream](https://github.com/dominictarr/pull-stream) source that produces data on state transitions\n\n## Simple Example\n\n``` js\nvar generate = require('pull-generate')\nvar pull = require('pull-stream')\n\npull(\n    generate(0, function(state, cb) {\n        cb(state\u003e3 ? true : null, 1\u003c\u003cstate, state + 1)\n    }),\n    pull.log()\n)\n\n// ==\u003e 1 2 4 8\n```\n\n## Usage\n\n### `generate(initialState, expand [, onAbort])`\n\n- `expand`: function that is called with `initialstate` and a callback.\n  - the callback has the following signature: `callback(err, data, newState)`\n      - `err`\n        - `null` to pass `data` downstream (normal operation)\n        - `true` indicates the end of the stream\n        - everything else is treated as an error\n      - `data` is send downstream (only if err === null)\n      - `newState` is used as `state` in the next call to `expand`.\n- onAbort: optional function that is called after the stream ended\n  - is called with `null` or an error object\n\n## License\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregular%2Fpull-generate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fregular%2Fpull-generate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fregular%2Fpull-generate/lists"}