{"id":17445965,"url":"https://github.com/jamen/ecodoc","last_synced_at":"2025-04-02T10:43:05.525Z","repository":{"id":57219330,"uuid":"84401237","full_name":"jamen/ecodoc","owner":"jamen","description":"Manage docs across multiple packages","archived":false,"fork":false,"pushed_at":"2017-03-12T04:02:58.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-09T17:50:01.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jamen.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":"2017-03-09T05:17:08.000Z","updated_at":"2021-12-19T15:39:16.000Z","dependencies_parsed_at":"2022-08-29T02:12:12.757Z","dependency_job_id":null,"html_url":"https://github.com/jamen/ecodoc","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fecodoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fecodoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fecodoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamen%2Fecodoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamen","download_url":"https://codeload.github.com/jamen/ecodoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246802594,"owners_count":20836365,"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-10-17T18:19:07.221Z","updated_at":"2025-04-02T10:43:05.502Z","avatar_url":"https://github.com/jamen.png","language":"JavaScript","funding_links":["https://www.paypal.me/jamenmarz/5usd"],"categories":[],"sub_categories":[],"readme":"\n# ecodoc\n\n\u003e Manage docs across multiple packages\n\nEcodoc maps an array of GitHub repository names to their info, contributors, latest version, and readme.\n\n## Install\n\n```sh\nnpm install --save ecodoc\n```\n\n## Usage\n\n**Note:** In order for this to work, you need to set `GH_TOKEN` environment variable, or pass in `opts.token`.  Otherwise, GitHub rate limits to 60 requests per hour.  This tool makes at least 1 request per repository to check if info is updated.  It makes 4 more requests for the info, contributors, tags, and README.\n\nIf you are lazy, you can just put `GH_TOKEN=...` in front of a command that runs `ecodoc`:\n\n```sh\nGH_TOKEN=... npm run build\n```\n\n### `ecodoc(opts)`\n\nCreate an ecodoc mapping function (called [`docs`](#api_docs)) with some options\n\n - `cache` (`String`): Path to where to store leveldb cache. **Required**\n - `token` (`String`): GitHub API Token. Defaults to `GH_TOKEN` env var. **Required**\n - `cacheMap` (`Function`): Map each project right before you cache it.\n - `map` (`Function`): Map all project info before you receive it.\n\n```js\nvar docs = ecodoc({\n  cache: __dirname + '/cache',\n  token: ..., // GH token, or just use `GH_TOKEN`\n})\n```\n\n### `docs(projects, done)`\n\nMap project names to their info, latest version, contributors, and readme.  They come from either requests or leveldb cache.\n\nYou can provide `projects` as an array of GitHub repos, as an object in groups of arrays.\n\n```js\ndocs([\n  'audiojs/audio',\n  'audiojs/audio-buffer'\n], function (err, projects) {\n  console.log(projects)\n  // [ { repo: 'audiojs/audio', latest_version: 'v1.2.0' ... }\n  //   { repo: 'audiojs/audio-buffer', latest_version: 'v1.0.0' ... } ]\n})\n```\n\nOr in groups:\n\n```js\ndocs({\n  core: [\n    'audiojs/audio',\n    'audiojs/audio-buffer'\n  ],\n  utility: [\n    'audiojs/is-audio-buffer'\n  ]\n}, function (err, projects) {\n  console.log(projects)\n  // [ { name: 'audio', group: 'core', ... },\n  //   { name: 'audio-buffer', group: 'core' },\n  //   { name: 'is-audio-buffer', group: 'utility' } ]\n})\n```\n\n### `project`\n\nThis object contains:\n\n```js\n{\n  name: 'audio',            // project name\n  repo: 'audiojs/audio',    // project repo\n  desc: '...',              // project description\n  group: 'core',            // project group (or falsy)\n  latest_version: 'v1.2.0', // latest git tag version\n  latest_ref: ...,          // latest git ref\n  readme: ...,              // README contents base64 encoded\n  contributors: [\n    {\n      username: 'dfcreative',                    // contributor username\n      profile: 'https://github.com/dfcreative',  // contributor profile\n      avatar: ...,                               // contributor avatar\n      id: 300067,                                // contributor id\n      contributions: 4                           // contributions\n    }\n    // ...\n  ]\n}\n```\n\n## License\n\nMIT © [Jamen Marz](https://git.io/jamen)\n\n---\n\n[![version](https://img.shields.io/npm/v/ecodoc.svg?style=flat-square)][package] [![travis](https://img.shields.io/travis/ecodoc/jamen.svg?style=flat-square)](https://travis-ci.org/ecodoc/jamen) [![downloads/month](https://img.shields.io/npm/dm/ecodoc.svg?style=flat-square)][package] [![downloads](https://img.shields.io/npm/dt/ecodoc.svg?style=flat-square)][package] [![license](https://img.shields.io/npm/l/ecodoc.svg?style=flat-square)][package] [![support me](https://img.shields.io/badge/support%20me-paypal-green.svg?style=flat-square)](https://www.paypal.me/jamenmarz/5usd) [![follow](https://img.shields.io/github/followers/jamen.svg?style=social\u0026label=Follow)](https://github.com/jamen)\n[package]: https://npmjs.com/package/ecodoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fecodoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamen%2Fecodoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamen%2Fecodoc/lists"}