جمع بيانات تعريف github حول مستودع.
التثبيت مع NPM:
$ npm install --save github-metadata
التثبيت مع الغزل:
$ yarn add github-metadata
var metadata = require ( 'github-metadata' ) ;
جمع بيانات تعريف Github للمستودع المحدد. هذه المحاولات للحصول على نفس البيانات الوصفية التي تستخدمها Jekyll وتحديدها في مستندات GitHub. تتطلب بعض البيانات الوصفية المصادقة التي تتطلب إما تمرير username
وكلمة password
أو token
على كائن options
. من الأفضل استخدام رمز الوصول الشخصي من GitHub. انظر قسم النتائج لمعرفة شكل كائن البيانات الوصفية التي تم إرجاعها
params
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
{Promise} : إرجاع وعد سيحصل على بيانات تعريف المستودعات عند حلها.مثال
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 لهذا المشروع بواسطة Verb ، يرجى عدم تحرير README مباشرة. أي تغييرات على readme يجب أن يتم في قالب.
لإنشاء README ، قم بتشغيل الأمر التالي:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
يعد تشغيل اختبارات الوحدة ومراجعتها طريقة رائعة للتعرف على مكتبة وواجهة برمجة التطبيقات الخاصة بها. يمكنك تثبيت التبعيات وتشغيل الاختبارات مع الأمر التالي:
$ npm install && npm test
براين وودوارد
حقوق الطبع والنشر © 2017 ، براين وودوارد. صدر تحت رخصة معهد ماساتشوستس للتكنولوجيا.
تم إنشاء هذا الملف بواسطة Verb-Generate-Readme ، v0.6.0 ، في 21 سبتمبر 2017.