{"id":22021546,"url":"https://github.com/lamansky/add-counter","last_synced_at":"2026-04-11T14:36:36.482Z","repository":{"id":57173140,"uuid":"120328007","full_name":"lamansky/add-counter","owner":"lamansky","description":"[Node.js] Adds a counter integer to iterated values.","archived":false,"fork":false,"pushed_at":"2018-02-05T16:08:24.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T14:18:40.095Z","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/lamansky.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-05T16:06:55.000Z","updated_at":"2018-02-05T16:08:26.000Z","dependencies_parsed_at":"2022-08-24T13:31:06.591Z","dependency_job_id":null,"html_url":"https://github.com/lamansky/add-counter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fadd-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fadd-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fadd-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fadd-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamansky","download_url":"https://codeload.github.com/lamansky/add-counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245085034,"owners_count":20558324,"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-30T06:12:45.086Z","updated_at":"2025-12-30T23:34:39.825Z","avatar_url":"https://github.com/lamansky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# add-counter\n\nAdds a counter integer to iterated values.\n\n## Installation\n\nRequires [Node.js](https://nodejs.org/) 6.0.0 or above.\n\n```bash\nnpm i add-counter\n```\n\n## API\n\nThe module exports a single function.\n\n### Parameters\n\n1. `iter` (iterable): The underlying iterable.\n2. Optional: `i` (integer): The starting value of the counter. Normally this would be either `0` or `1`. Defaults to `0`.\n\n### Return Value\n\nA generator that, for each iterated value `x`, yields `[i++, x]`\n\n## Example\n\n```javascript\nconst addCounter = require('add-counter')\n\nfor (const [i, x] of addCounter(['a', 'b', 'c'])) {\n  // [0, 'a']\n  // [1, 'b']\n  // [2, 'c']\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fadd-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamansky%2Fadd-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fadd-counter/lists"}