{"id":21558105,"url":"https://github.com/koopjs/geohub","last_synced_at":"2025-08-18T12:17:20.768Z","repository":{"id":57249816,"uuid":"11536219","full_name":"koopjs/geohub","owner":"koopjs","description":"GeoJSON extractor for Github repos and gists.","archived":false,"fork":false,"pushed_at":"2022-12-09T18:20:32.000Z","size":336,"stargazers_count":16,"open_issues_count":8,"forks_count":5,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-24T09:38:15.423Z","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/koopjs.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}},"created_at":"2013-07-19T20:08:37.000Z","updated_at":"2023-07-13T22:55:30.000Z","dependencies_parsed_at":"2023-01-25T23:00:18.602Z","dependency_job_id":null,"html_url":"https://github.com/koopjs/geohub","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/koopjs%2Fgeohub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fgeohub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fgeohub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koopjs%2Fgeohub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koopjs","download_url":"https://codeload.github.com/koopjs/geohub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737769,"owners_count":20987718,"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-24T08:13:59.034Z","updated_at":"2025-04-10T10:42:06.938Z","avatar_url":"https://github.com/koopjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# geohub\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/koopjs/geohub.svg)](https://greenkeeper.io/)\n\n\u003e GeoJSON extractor for Github repos and gists.\n\n[![npm version][npm-img]][npm-url]\n[![build status][travis-image]][travis-url]\n\n[npm-img]: https://img.shields.io/npm/v/geohub.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/geohub\n[travis-image]: https://img.shields.io/travis/koopjs/geohub/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koopjs/geohub\n\nExtracts and parses GeoJSON files from Github repos and gists using the Github API.\n\n## Install\n\n```\nnpm install geohub\n```\n\n## Usage\n\n```js\ngeohub = require('geohub')\n\nvar user = 'chelm'\nvar repo = 'grunt-geo'\nvar path = 'forks'\n\n// Extract GeoJSON from a specific path in a repository\ngeohub.repo({\n  user: user,  // username\n  repo: repo,  // repository\n  path: path,  // path to file or directory\n  token: token // github access token\n}, function (err, data) {\n  if (err) throw err\n  console.log(data)\n  // =\u003e if path is a directory, data is an array of geojson objects\n  // =\u003e if path is a filename (omit .geojson extension), data is a geojson object\n})\n\n// Omit the 'path' option to extract all GeoJSON files from a repository\ngeohub.repo({\n  user: user,  // username\n  repo: repo,  // repository\n  token: token // github access token\n}, function (err, data) {\n  if (err) throw err\n  console.log(data)\n  // =\u003e data is an array of geojson objects\n})\n\n// You can also extract GeoJSON from a specific branch of a repo\ngeohub.repo({\n  user: 'koopjs',           // username\n  repo: 'geohub',           // repository\n  branch: 'do-not-delete',  // branch name\n  path: 'portland-parks',   // path to file or directory\n  token: token              // github access token\n}, function (err, data) {\n  if (err) throw err\n  console.log(data)\n  // =\u003e data is a geojson object\n})\n\n// Check a file's SHA (useful for caching)\ngeohub.repoSha({\n  user: user,  // username\n  repo: repo,  // repository\n  path: path,  // path to file\n  token: token // github access token\n}, function (err, sha) {\n  if (err) throw err\n  console.log(sha)\n  // =\u003e SHA string\n})\n\n// Extract GeoJSON from a gist\ngeohub.gist({\n  id: 6021269, // gist ID\n  token: token // github access token\n}, function (err, data) {\n  if (err) throw err\n  console.log(data)\n  // =\u003e data is an array of geojson objects\n})\n```\n\n## Test\n\nGeohub uses [tape](https://github.com/substack/tape) for testing. It is recommended to create your own Github [access token](https://github.com/settings/tokens) for use during testing to ensure you will not hit Github API rate limits.\n\n```\nGITHUB_TOKEN=XXXXXX npm test\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fgeohub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoopjs%2Fgeohub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoopjs%2Fgeohub/lists"}