{"id":18434729,"url":"https://github.com/assemble/grunt-github-api","last_synced_at":"2025-04-07T19:31:59.046Z","repository":{"id":66211894,"uuid":"9718601","full_name":"assemble/grunt-github-api","owner":"assemble","description":"Grunt plugin used to query the Github API and save the returned JSON files locally.","archived":false,"fork":false,"pushed_at":"2013-10-30T01:20:38.000Z","size":287,"stargazers_count":17,"open_issues_count":2,"forks_count":4,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-23T00:05:09.832Z","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/assemble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-27T17:40:03.000Z","updated_at":"2017-01-25T00:32:34.000Z","dependencies_parsed_at":"2023-02-20T00:10:19.802Z","dependency_job_id":null,"html_url":"https://github.com/assemble/grunt-github-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fgrunt-github-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fgrunt-github-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fgrunt-github-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/assemble%2Fgrunt-github-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/assemble","download_url":"https://codeload.github.com/assemble/grunt-github-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247716369,"owners_count":20984228,"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-06T06:05:08.063Z","updated_at":"2025-04-07T19:31:58.803Z","avatar_url":"https://github.com/assemble.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-github-api [![NPM version](https://badge.fury.io/js/grunt-github-api.png)](http://badge.fury.io/js/grunt-github-api) \n\n\u003e Query Github's API and save the returned JSON files locally.\n\nProject authored and maintained by [github/https://github.com/jeffHerb](https://github.com/jeffHerb).\n\n## Getting Started\n\nThis plugin requires Grunt ~0.4.0\n\nIf you haven't used Grunt before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n    npm install grunt-github-api --save-dev\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n    grunt.loadNpmTasks('grunt-github-api');\n\nRun this task with the `grunt github` command.\n\nTask targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.\n\n\n## Options\nOptions for this plugin are broken down into sub-option categories as defined below. Please note that all option sections by default are objects and contain simple key-value pairs unless otherwise noted.\n\n\n### output\n\u003e Used to idenify where cache and downloaded request data should be stored by default\n\n* **path**: _default: 'api-data'_ - special location where all data is collected when saved to disk, when no specific destination is definded under the targets `dest`.\n* **cache**:  _default: '.cache.json'_ - plugin cache file name. Will be stored under under the output path defined above.\n\n#### format\n* **indent**:  _default: 4_ - number of spaces each indent should take up.\n* **encoding**:  _default: 'utf8'_ - file format all data written to disk should be in.\n\nExamples:\n\n```js\n{\n  options: {\n    output: {\n      path: 'my/api/data/',\n      cache: 'my/api/cache/'\n      format: {\n        indent: 4,\n        encoding: 'utf8'\n      }\n    }\n  }\n}\n```\n\n\n### connection\n\u003e Connection headers used when connecting the GitHub.\n\n* **host**: _default: api.github.com_ - default GitHub API portal\n* **headers**: _default: {Object}_ used to define the nodejs `HTTPS` headers.\n    - `User-Agent`: `node-http/0.10.1`\n    - `Content-Type`: `application/json`\n\nExamples:\n\n```js\n{\n  options: {\n    connection: {\n      host: 'api.github.com',\n      headers: {\n        'User-Agent': 'node-http/0.10.1',\n        'Content-Type': 'application/json'\n      }\n    }\n  }\n}\n```\n\n### type\n\u003e Type of data the task will be downloading\n\nIndicates the type of request, may be set to either `data` or `file`. Default is `data`.\n\n### cache\n\u003e Control which files do or do not get tracked for changes.\n\nSpecifies whether or not to cache API responses. Default is `true`.\n\n### concat\n\u003e Concatinate JSON data together before writting it to a file when property is set to `true`. Default is `false`.\n\n### filters\n\u003e Query search parameters\n\nAdditional information about different filters can be found in the [Github Developer Documentation](http://developer.github.com/).\n\n\n### oAuth\n\u003e GitHub access credentials\n\nThese credentials are required to preform many actions or continual usage of the plugin. In order to get access using oAuth the repo owner will need to create an access token via their [Application Settings](https://github.com/settings/applications) page.\n\n\n\n\n## Usage Examples\n### Targets\n\n* `src`: is the specified API query path. Source paths are everything that appears after `api.github.com`. Additional information about different query paths can be found in the [Github Developer Documentation](http://developer.github.com/). The `src` can be an `array` or a `string` value.\n* `dest`: (optional) - is the path and filename where the retured request should be saved. If nothing is given files will be saved into the same path as the task cache file and will be broken down into a folder structure that mimics its query path. (EXCEPTION: If you define multiple sources that are being concatenated together, you must define at least a filename).\n\n\n### Configuration\n\nOptions may be defined at either the task and/or target levels (_target-level options override task-level options_).\n\n```js\ngithub: {\n  // Concatentate returned JSON responses into a single file.\n  combindedIssues: {\n    options: {\n      filters: {\n        state: 'open'\n      },\n      task: {\n        concat: true\n      }\n    },\n    src: [\n      '/repos/assemble/grunt-github-api-example/issues',\n      '/repos/assemble/grunt-github-api/issues'\n    ],\n    dest: 'combinded-issues.json'\n    // File created will be save along the gruntfile.\n  },\n\n  // Create two different files from two different repos.\n  seperateIssues: {\n    options: {\n      // Access repo using credentials provided\n      oAuth: {\n        access_token: 'XXXXXXXXXXXXXXXXXX'\n      }\n    },\n    src: [\n      '/repos/assemble/grunt-github-api-example/issues',\n      '/repos/assemble/grunt-github-api/issues'\n    ]\n    // Files created will be saved inside the api-data folder\n  },\n\n  // Downloads a copy of the example.json file from GitHub.\n  examplePkg: {\n    options: {\n      task: {\n        type: 'file',\n      }\n    },\n    src: '/repos/assemble/grunt-github-api-example/contents/example.json'\n    // File created will be saved inside the api-data folder\n  }\n}\n```\n\n\n\n## Contributing\nPlease see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project.\n\n## Author\n\n+ [github/https://github.com/jeffHerb](https://github.com/jeffHerb)\n\n\n\n## License\nCopyright (c) 2013 Jeffrey Herb, contributors.\nReleased under the MIT license\n\n***\n\n_This file was generated on Tue Oct 29 2013 21:13:51._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fgrunt-github-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fassemble%2Fgrunt-github-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fassemble%2Fgrunt-github-api/lists"}