저장소에 대한 Github 메타 데이터를 수집하십시오.
NPM으로 설치 :
$ npm install --save github-metadata
원사로 설치하십시오 :
$ yarn add github-metadata
var metadata = require ( 'github-metadata' ) ;
지정된 저장소를 위해 GitHub 메타 데이터를 수집하십시오. 이것은 Jekyll에서 사용하고 Github 문서에 지정된 것과 동일한 메타 데이터를 얻으려고 시도합니다. 메타 데이터 중 일부는 options
개체에서 username
과 password
또는 token
전달 해야하는 인증이 필요합니다. Github의 개인 액세스 토큰을 사용하는 것이 가장 좋습니다. 반환 된 메타 데이터 객체가 어떻게 보이는지 확인하려면 결과 섹션을 참조하십시오.
매개 변수
options
{object} : 인증 및 저장소 세부 사항을 포함하는 옵션 개체.options.owner
{String} : 저장소를 소유 한 사용자 또는 조직. 이것은 "https://github.com/"다음 첫 번째 경로 세그먼트입니다.options.repo
{String} : 메타 데이터를 얻을 수있는 저장소 이름입니다. 이것은 "https://github.com/"다음 두 번째 경로 세그먼트입니다.options.exclude
{array} : 선택적으로 Github에서 다운로드하지 않음으로써 메타 데이터에서 제외 할 최상위 속성 목록을 전달합니다.options.username
{String} : 선택적으로 인증을 위해 GitHub 사용자 이름을 제공합니다. 인증을 위해 username/password
사용할 때만 필요합니다.options.password
{String} : 선택적으로 인증을 위해 GitHub 비밀번호를 제공합니다. 인증을 위해 username/password
사용할 때만 필요합니다.options.token
{String} : 선택적으로 인증을 위해 GitHub 개인 액세스 토큰을 제공합니다. 인증을 위해 OAUTH ( username/password
대신)를 사용하는 경우에만 필요합니다.returns
. 해결할 때 리포지토리가 메타 데이터를 갖는 약속을 반환합니다.예
var options = {
token : 'XXXXXXXXXX' // get this from GitHub,
owner : 'doowb' ,
repo : 'github-metadata'
} ;
metadata ( options )
. then ( function ( data ) {
console . log ( data ) ;
//=> {
//=> // this object contains all of the metadata that was gather from GitHub
//=> }
} )
. catch ( console . error ) ;
다음 객체는 조립/조립 저장소에 대해 반환되는 Github 메타 데이터를 나타냅니다. 긴 배열이 포함 된 속성의 항목이 제거되어 대체되었습니다 ...
해당 배열의 항목에 대한 자세한 내용은 전체 JSON 개체 및 GitHub API 문서를 참조하십시오.
{
"public_repositories" : [
...
] ,
"organization_members" : [
...
] ,
"contributors" : [
...
] ,
"collaborators" : [
...
] ,
"branches" : [
...
] ,
"languages" : {
"CSS" : 483616 ,
"JavaScript" : 102873 ,
"HTML" : 44790
} ,
"teams" : [
...
] ,
"releases" : [
...
] ,
"tags" : [
...
] ,
"repository" : {
"id" : 5916767 ,
"name" : "assemble" ,
"full_name" : "assemble/assemble" ,
"owner" : {
"login" : "assemble" ,
"id" : 2645080 ,
"avatar_url" : "https://avatars3.githubusercontent.com/u/2645080?v=3" ,
"gravatar_id" : "" ,
"url" : "https://api.github.com/users/assemble" ,
"html_url" : "https://github.com/assemble" ,
"followers_url" : "https://api.github.com/users/assemble/followers" ,
"following_url" : "https://api.github.com/users/assemble/following{/other_user}" ,
"gists_url" : "https://api.github.com/users/assemble/gists{/gist_id}" ,
"starred_url" : "https://api.github.com/users/assemble/starred{/owner}{/repo}" ,
"subscriptions_url" : "https://api.github.com/users/assemble/subscriptions" ,
"organizations_url" : "https://api.github.com/users/assemble/orgs" ,
"repos_url" : "https://api.github.com/users/assemble/repos" ,
"events_url" : "https://api.github.com/users/assemble/events{/privacy}" ,
"received_events_url" : "https://api.github.com/users/assemble/received_events" ,
"type" : "Organization" ,
"site_admin" : false
} ,
"private" : false ,
"html_url" : "https://github.com/assemble/assemble" ,
"description" : "Static site generator and rapid prototyping framework for Node.js, Grunt.js, and Yeoman and Gulp. Render templates with Handlebars, Lo-Dash or any template engine. Used by Less.js / lesscss.org, Topcoat, Web Experience Toolkit, and hundreds of other projects to build sites, themes, components, documentation, blogs and gh-pages." ,
"fork" : false ,
"url" : "https://api.github.com/repos/assemble/assemble" ,
"forks_url" : "https://api.github.com/repos/assemble/assemble/forks" ,
"keys_url" : "https://api.github.com/repos/assemble/assemble/keys{/key_id}" ,
"collaborators_url" : "https://api.github.com/repos/assemble/assemble/collaborators{/collaborator}" ,
"teams_url" : "https://api.github.com/repos/assemble/assemble/teams" ,
"hooks_url" : "https://api.github.com/repos/assemble/assemble/hooks" ,
"issue_events_url" : "https://api.github.com/repos/assemble/assemble/issues/events{/number}" ,
"events_url" : "https://api.github.com/repos/assemble/assemble/events" ,
"assignees_url" : "https://api.github.com/repos/assemble/assemble/assignees{/user}" ,
"branches_url" : "https://api.github.com/repos/assemble/assemble/branches{/branch}" ,
"tags_url" : "https://api.github.com/repos/assemble/assemble/tags" ,
"blobs_url" : "https://api.github.com/repos/assemble/assemble/git/blobs{/sha}" ,
"git_tags_url" : "https://api.github.com/repos/assemble/assemble/git/tags{/sha}" ,
"git_refs_url" : "https://api.github.com/repos/assemble/assemble/git/refs{/sha}" ,
"trees_url" : "https://api.github.com/repos/assemble/assemble/git/trees{/sha}" ,
"statuses_url" : "https://api.github.com/repos/assemble/assemble/statuses/{sha}" ,
"languages_url" : "https://api.github.com/repos/assemble/assemble/languages" ,
"stargazers_url" : "https://api.github.com/repos/assemble/assemble/stargazers" ,
"contributors_url" : "https://api.github.com/repos/assemble/assemble/contributors" ,
"subscribers_url" : "https://api.github.com/repos/assemble/assemble/subscribers" ,
"subscription_url" : "https://api.github.com/repos/assemble/assemble/subscription" ,
"commits_url" : "https://api.github.com/repos/assemble/assemble/commits{/sha}" ,
"git_commits_url" : "https://api.github.com/repos/assemble/assemble/git/commits{/sha}" ,
"comments_url" : "https://api.github.com/repos/assemble/assemble/comments{/number}" ,
"issue_comment_url" : "https://api.github.com/repos/assemble/assemble/issues/comments{/number}" ,
"contents_url" : "https://api.github.com/repos/assemble/assemble/contents/{+path}" ,
"compare_url" : "https://api.github.com/repos/assemble/assemble/compare/{base}...{head}" ,
"merges_url" : "https://api.github.com/repos/assemble/assemble/merges" ,
"archive_url" : "https://api.github.com/repos/assemble/assemble/{archive_format}{/ref}" ,
"downloads_url" : "https://api.github.com/repos/assemble/assemble/downloads" ,
"issues_url" : "https://api.github.com/repos/assemble/assemble/issues{/number}" ,
"pulls_url" : "https://api.github.com/repos/assemble/assemble/pulls{/number}" ,
"milestones_url" : "https://api.github.com/repos/assemble/assemble/milestones{/number}" ,
"notifications_url" : "https://api.github.com/repos/assemble/assemble/notifications{?since,all,participating}" ,
"labels_url" : "https://api.github.com/repos/assemble/assemble/labels{/name}" ,
"releases_url" : "https://api.github.com/repos/assemble/assemble/releases{/id}" ,
"deployments_url" : "https://api.github.com/repos/assemble/assemble/deployments" ,
"created_at" : "2012-09-22T20:50:23Z" ,
"updated_at" : "2017-06-15T01:09:31Z" ,
"pushed_at" : "2017-05-20T00:33:33Z" ,
"git_url" : "git://github.com/assemble/assemble.git" ,
"ssh_url" : "[email protected]:assemble/assemble.git" ,
"clone_url" : "https://github.com/assemble/assemble.git" ,
"svn_url" : "https://github.com/assemble/assemble" ,
"homepage" : "http://assemble.io/" ,
"size" : 13050 ,
"stargazers_count" : 3350 ,
"watchers_count" : 3350 ,
"language" : "CSS" ,
"has_issues" : true ,
"has_projects" : true ,
"has_downloads" : true ,
"has_wiki" : true ,
"has_pages" : false ,
"forks_count" : 225 ,
"mirror_url" : null ,
"open_issues_count" : 26 ,
"forks" : 225 ,
"open_issues" : 26 ,
"watchers" : 3350 ,
"default_branch" : "master" ,
"permissions" : {
"admin" : true ,
"push" : true ,
"pull" : true
} ,
"allow_squash_merge" : true ,
"allow_merge_commit" : true ,
"allow_rebase_merge" : true ,
"organization" : {
"login" : "assemble" ,
"id" : 2645080 ,
"avatar_url" : "https://avatars3.githubusercontent.com/u/2645080?v=3" ,
"gravatar_id" : "" ,
"url" : "https://api.github.com/users/assemble" ,
"html_url" : "https://github.com/assemble" ,
"followers_url" : "https://api.github.com/users/assemble/followers" ,
"following_url" : "https://api.github.com/users/assemble/following{/other_user}" ,
"gists_url" : "https://api.github.com/users/assemble/gists{/gist_id}" ,
"starred_url" : "https://api.github.com/users/assemble/starred{/owner}{/repo}" ,
"subscriptions_url" : "https://api.github.com/users/assemble/subscriptions" ,
"organizations_url" : "https://api.github.com/users/assemble/orgs" ,
"repos_url" : "https://api.github.com/users/assemble/repos" ,
"events_url" : "https://api.github.com/users/assemble/events{/privacy}" ,
"received_events_url" : "https://api.github.com/users/assemble/received_events" ,
"type" : "Organization" ,
"site_admin" : false
} ,
"network_count" : 225 ,
"subscribers_count" : 121
} ,
"pages_info" : {
"message" : "Not Found" ,
"documentation_url" : "https://developer.github.com/v3"
} ,
"pages" : {
"env" : "development" ,
"test" : false ,
"dotcom" : false ,
"enterprise" : false ,
"development" : true ,
"ssl" : false ,
"schema" : "http" ,
"custom_domains_enabled" : false ,
"github_hostname" : "github.com" ,
"pages_hostname" : "localhost:4000" ,
"github_url" : "http://github.com" ,
"api_url" : "https://api.github.com" ,
"help_url" : "https://help.github.com"
} ,
"hostname" : "github.com" ,
"pages_hostname" : "localhost:4000" ,
"api_url" : "https://api.github.com" ,
"help_url" : "https://help.github.com" ,
"environment" : "development" ,
"pages_env" : "development" ,
"url" : "https://github.com/assemble/assemble" ,
"project_title" : "assemble" ,
"repository_name" : "assemble" ,
"repository_nwo" : "assemble/assemble" ,
"project_tagline" : "Static site generator and rapid prototyping framework for Node.js, Grunt.js, and Yeoman and Gulp. Render templates with Handlebars, Lo-Dash or any template engine. Used by Less.js / lesscss.org, Topcoat, Web Experience Toolkit, and hundreds of other projects to build sites, themes, components, documentation, blogs and gh-pages." ,
"owner_name" : "assemble" ,
"owner_gravatar_url" : "http://github.com/assemble.png}" ,
"repository_url" : "https://github.com/assemble/assemble" ,
"language" : "CSS" ,
"show_downloads" : true ,
"owner_url" : "http://github.com/assemble" ,
"zip_url" : "http://github.com/assemble/assemble/zipball/gh_pages" ,
"tar_url" : "http://github.com/assemble/assemble/tarball/gh_pages" ,
"clone_url" : "http://github.com/assemble/assemble.git" ,
"releases_url" : "http://github.com/assemble/assemble/releases" ,
"issues_url" : "http://github.com/assemble/assemble/issues" ,
"wiki_url" : "http://github.com/assemble/assemble/wiki" ,
"is_user_page" : false ,
"is_project_page" : true
}
풀 요청과 별은 항상 환영합니다. 버그 및 기능 요청은 문제를 만듭니다.
기고 가이드를 읽으십시오. 개방 문제, 요청을 당기고 코딩 표준에 대한 조언을 받으십시오.
(이 프로젝트의 readme.md는 동사에 의해 생성됩니다. readme를 직접 편집하지 마십시오. readme에 대한 모든 변경 사항은 .verb.md readme 템플릿에서 작성해야합니다.)
readme를 생성하려면 다음 명령을 실행하십시오.
$ npm install -g verbose/verb#dev verb-generate-readme && verb
단위 테스트를 실행하고 검토하는 것은 라이브러리와 API에 익숙해지는 좋은 방법입니다. 다음 명령으로 종속성을 설치하고 테스트를 실행할 수 있습니다.
$ npm install && npm test
브라이언 우드워드
Copyright © 2017, Brian Woodward. MIT 라이센스에 따라 릴리스.
이 파일은 2017 년 9 월 21 일에 동사 세대 판독 Me, v0.6.0에 의해 생성되었습니다.