在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:assemble/grunt-github-api开源软件地址:https://github.com/assemble/grunt-github-api开源编程语言:JavaScript 100.0%开源软件介绍:grunt-github-api
Project authored and maintained by github/https://github.com/jeffHerb. Getting StartedThis plugin requires Grunt ~0.4.0 If you haven't used Grunt before, be sure to check out the 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:
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Run this task with the Task targets, files and options may be specified according to the grunt Configuring tasks guide. OptionsOptions 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. output
format
Examples: {
options: {
output: {
path: 'my/api/data/',
cache: 'my/api/cache/'
format: {
indent: 4,
encoding: 'utf8'
}
}
}
} connection
Examples: {
options: {
connection: {
host: 'api.github.com',
headers: {
'User-Agent': 'node-http/0.10.1',
'Content-Type': 'application/json'
}
}
}
} type
Indicates the type of request, may be set to either cache
Specifies whether or not to cache API responses. Default is concat
filters
Additional information about different filters can be found in the Github Developer Documentation. oAuth
These 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 page. Usage ExamplesTargets
ConfigurationOptions may be defined at either the task and/or target levels (target-level options override task-level options). github: {
// Concatentate returned JSON responses into a single file.
combindedIssues: {
options: {
filters: {
state: 'open'
},
task: {
concat: true
}
},
src: [
'/repos/assemble/grunt-github-api-example/issues',
'/repos/assemble/grunt-github-api/issues'
],
dest: 'combinded-issues.json'
// File created will be save along the gruntfile.
},
// Create two different files from two different repos.
seperateIssues: {
options: {
// Access repo using credentials provided
oAuth: {
access_token: 'XXXXXXXXXXXXXXXXXX'
}
},
src: [
'/repos/assemble/grunt-github-api-example/issues',
'/repos/assemble/grunt-github-api/issues'
]
// Files created will be saved inside the api-data folder
},
// Downloads a copy of the example.json file from GitHub.
examplePkg: {
options: {
task: {
type: 'file',
}
},
src: '/repos/assemble/grunt-github-api-example/contents/example.json'
// File created will be saved inside the api-data folder
}
} ContributingPlease see the Contributing to Assemble guide for information on contributing to this project. AuthorLicenseCopyright (c) 2013 Jeffrey Herb, contributors. Released under the MIT license This file was generated on Tue Oct 29 2013 21:13:51. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论