VimUnDo qT 3GCѕ.}<KKKKW!Y_Wژ5_*Wژ*module.exports = function (github-token) {5_!Wژ*module.exports = function (github-token) {5_Wژ*module.exports = function (github_token) {5_Wژ"module.exports = (github_token) {5_Wژ!module.exports = (github_token) {5_Wڙ}5_ $Wڙ$module.exports = (github_token) => {5_ Wڙ5_ Wڙ$module.exports = (github_token) => {5_ (Wڙ,module.exports = function(github_token) => {5_ )Wڙ )module.exports = function(github_token) {5_  !Wڙ )module.exports = function(github_token) {5_ +Wڙ.module.exports = function(github_auth_token) {5_Wڙ5_Wڙconst got = require('got');5_Wڙ 5_Wڙ!5_vWڙ%0module.exports = function(github_auth_token, ) {5_vWڙ&function(github_auth_token, ) {5_vWڙ. function (github_auth_token, ) {5_ vWڙ51function (github_auth_token, dependent_modules) {5_vWڙ:;function appreciate(github_auth_token, dependent_modules) {5_vWڙ@?function are_appreciate(github_auth_token, dependent_modules) {5_vWڙB};5_ vWڙOfunction find_dependent_modules5_ vWڙS function 5_ vWڙ}function dependent_git_repos5_ vWڙ~ function 5_ "vWڙ "function find_github_repos(path) {5_! vWڙ };5_ "! vWڙ }5_!#" vWڙ 5_"$# vWڙ 5_#%$"vWڙ "function find_github_repos(path) {5_$&%vWڙ "function find_github_repos(path) {5_%'&vWڙ function find_(path) {5_&(' vWڙ  if (path5_')( vWڙ  if (path ==5_(*) vWڙ  if (typeof path ==5_)+* vWڙ  if ( path ==5_*,+ vWڙ  if (! path ==5_+-, vWڙ  if (!path ==5_,.- vWڙ 5_-/. vWڙ 5_.0/ vWڙ  if (!path) {5_/10 vWڙ  path 5_021 vWڙ 5_132 vWڙ  path = 5_243 vWڙ }5_354 vWڙ  function read_auth_token(path) {5_465vWڙ 5_576vWڮ`const got = require('got');5_687vWڮaconst 5_798vWڮc5_8:9vWڮc5_9;: vWڮ  path = '.';5_:<; vWڮ  }5_;=<vWگconst got = require('got');5_<>=vWگ }5_=?>vWگ function read_auth_token(path) {5_>@?vWگfunction read_auth_token() {5_?A@ vWگ if (!path) {5_@BA vWگ if (!) {5_ACBvWگ path = '~/.appreciate';5_BDCvWگ = '~/.appreciate';5_CEDvWڰ fs.exists(path)5_DFEvWڰ fs.exists()5_EGFvWڰ fs.exists(auth_file)5_FHG+vWڰ+ fs.exists(auth_file).then((exists) => {5_GIHvWڰ });5_HJIvWڰ })5_ILJ vWڰ: .catch((5_JMKLvWڰ<+ fs.exists(auth_file).then((exists) => {5_LNM2vWڰB2 return fs.exists(auth_file).then((exists) => {5_MONvWI })5_NPO2vWJ2 return fs.exists(auth_file).then((exists) => {5_OQPvWٜ2 return fs.exists(auth_file).then((exists) => {5_PRQvWٜ, return fs.(auth_file).then((exists) => {5_QSRvWٞ5_RTSvWٞ5_SUT4vWٟ4 return fs.readFile(auth_file).then((exists) => {5_TVU(vWo4 return fs.readFile(auth_file).then((exists) => {5_UWV(vWr. return fs.readFile(auth_file).then(() => {5_VXW:vWt: return fs.readFile(auth_file).then((token_buffer) => {5_WYXvWy5_XZYvWz 5_Y[ZvW~ // Encofing5_Z\[%vWډ' return token_buffer.toString();5_[]\,vWڍ 5_\^]vW: return fs.readFile(auth_file).then((token_buffer) => {$ auth_file = '~/.appreciate'; if (!auth_file) {%function read_auth_token(auth_file) {5_]_^ vW ,function find_node_modules_on_github(path) {5_^`_ vW ,function find_node_modules_on_github(path) {5__b` vW +function findnode_modules_on_github(path) {5_`cab vW +function findNode_modules_on_github(path) {5_bdc vW *function findNodemodules_on_github(path) {5_ced vW *function findNodeModules_on_github(path) {5_dfe vW *function findNodeModules_on_github(path) {5_egf vW )function findNodeModuleson_github(path) {5_fhg vW )function findNodeModulesOn_github(path) {5_gih vW (function findNodeModulesOngithub(path) {5_hji vW@function are_appreciated(github_auth_token, dependent_modules) {5_ikj vW?function areappreciated(github_auth_token, dependent_modules) {5_jlkvW?function areAppreciated(github_auth_token, dependent_modules) {5_kmlvW>function areAppreciated(githubauth_token, dependent_modules) {5_lnm"vW>function areAppreciated(githubAuth_token, dependent_modules) {5_mpn"vW=function areAppreciated(githubAuthtoken, dependent_modules) {5_nqop2vW=function areAppreciated(githubAuthToken, dependent_modules) {5_prq2vW {5_rts,vW8 return fs.readFile(authFile).then((tokenbuffer) => {5_sutvW- return token_buffer.toString('utf8');5_tvuvW, return tokenbuffer.toString('utf8');5_uwvvW}5_vxwvWmodule.exports = {5_wyxvW5_xzyvW 5_y{z vW$function read_auth_token(authFile) {5_z|{ vW#function readauth_token(authFile) {5_{}|vW#function readAuth_token(authFile) {5_|~}vW"function readAuthtoken(authFile) {5_}~vW  rea5_~ vW}5_vW const got = require('got');5_vW  const got = require('gh-got');5_vW$  const ghgot = require('gh-got');5_ vW* 5_ vW+ 5_&vW 8 return fs.readFile(authFile).then((tokenBuffer) => {5_1vW 7 return fs.readFile(authFile).then(tokenBuffer) => {5_vWconst fs = require('mz/fs');5_vW# authFile = '~/.appreciate';5_0vW1 authFile = expandHomeDir('~/.appreciate';5_vW const ghGot = require('gh-got');5_W }5_--1 vW1,2>& let info = repoStr.split('/'); return { user: info[0], repo: info[1] };5_1-1 vW203> };5_4 -1 vW>35? if 5_3 -1 vWB26? } else {5_6 -1 vW\57A if (5_62-1 vWg5:A2 if (repoUrl.indexOf('github.com') == -1) {5_8-1 vWm7:D } else {5_7-1 vWn68F 68E5_60-1 vW57G 57F5_3 -1 vW26G } else {5_5-1 vW46J 46I5_5-1 vW46J& // Most likely mal-formed 5_5%-1 vW47J% // Most likely malformed 5_7 -1 vW69K }5_7 -1 vW68L }5_88AvW7BL 3 let repoType = packageJSON.repository.type,1 repoUrl = packageJSON.repository.url; if (repoType !== 'git') 2 if (repoUrl.indexOf('github.com') == -1) {1 // If the URL does not contain .com,  return null; } else { }5_88AvW785_@8@vW?@5_:$8@vW9<J$ if (repoType !== 'git') 5_; 8AvW:<L :<K5_;8BvW:<M :<L5_868CvW79M7 let repoType = packageJSON.repository.type,5_958CvW8:M5 repoUrl = packageJSON.repository.url;5_A8CvW@CM } else {5_= 8DvW<>N }5_>>C vW=DN6 if (repoUrl.indexOf('github.com') == -1) {5 // If the URL does not contain .com,  return null; } else { }5_C>C vWBEN }5_A>C vW@CO } else {5_>>D vW=?Q =?P5_???0v0W>@Q: if (repoUrl.indexOf('github.com') == -1) {5_>$??0v0W=?Q% let idxOfGithubCom = >?Q5_>B??0v0W=?QB let idxOfGithubCom = repoUrl.indexOf('github.com')5_???0v0W>@Q if ( == -1) {5_?$??0v0W >@Q+ if (idxOfGithubCom == -1) {5_C??0v0W'BEQ let url = 5_C??0v0WrBDRf let url = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$//);5_C??0v0WrBDRc let = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$//);5_C ??0v0WxBDRn let userRepoStr = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$//);5_Ck??0v0WxBDRk let userRepo = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$//);5_Ch??0v0WBDRv let userRepo = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$//).split('/');5_Ch??0v0WBDRu let userRepo = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$/).split('/');5_D??0v0WCFR return 5_E??0v0WDGT DFS5_G??0v0WFHU }5_ H??0v0WGH5_  J??0v0WIKT }5_   J ??0v0WILT }5_   ;??0v0W?A9 // If the URL does not contain .com, :<2 // We are looking only for Github 5_   -??0v0W,.U* let info = repoStr.split('/');5_  -??0v0W,.U& let = repoStr.split('/');5_ /??0v0W.0U user: info[0],5_/??0v0W.0U user: [0],5_/??0v0W.0U! user: userRep[0],5_0??0v0W/1U repo: info[1]5_0??0v0W/1U repo: [1]5_CV??0v0W8BDUy let userRepo = repoUrl.substr(idxOfGithubCom + 'github.com'.length).replace(/\.git$/, '').split('/');5_C*??0v0WPBEU} let userRepo = repoUrl.substr(idxOfGithubCom + 'github.com'.length + 1).replace(/\.git$/, '').split('/');5_DI??0v0WRCFVk .substr(idxOfGithubCom + 'github.com'.length + 1).replace(/\.git$/, '').split('/');5_E.??0v0WTDGW: .replace(/\.git$/, '').split('/');5_F$??0v0WUEHX$ .split('/');5_DI??0v0WVCEYI .substr(idxOfGithubCom + 'github.com'.length + 1)5_E.??0v0WcDFY. .replace(/\.git$/, '')5_F$??0v0WnEGY$ .split('/');5_P??0v0WzOP5_??0v0WX 'use strict';#// const ghGot = require('gh-got');const fs = require('mz/fs');1const expandHomeDir = require('expand-home-dir');Bfunction areAppreciated(/* githubAuthToken, dependentModules */) {}(function findNodeModulesOnGithub(path) { if (!path) { path = './node_modules'; }}"function readAuthToken(authFile) { if (!authFile) {2 authFile = expandHomeDir('~/.appreciate'); }6 return fs.readFile(authFile).then(tokenBuffer => {' // Convert the buffer to string3 return tokenBuffer.toString('utf8').trim(); });}.function getProjectDependencies(packageJSON) {f let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];f let devDependencies = packageJSON.devDependencies ? Object.keys(packageJSON.devDependencies) : [];0 return dependencies.concat(devDependencies);}*function getProjectUserRepo(packageJSON) {- if (!packageJSON.repository) return null;5 if (typeof packageJSON.repository === 'string') {- let repoStr = packageJSON.repository;* if (repoStr.indexOf(':') !== -1) {= // This means that the location is not on Github.O // As Github does not allow ':' in the names and the other services% // use it as a delimiter. return null; } else {. let userRepo = repoStr.split('/'); return {" user: userRepo[0],! repo: userRepo[1] }; } } else {J if (!packageJSON.repository.type || !packageJSON.repository.url) {1 // Most likely malformed package.json return null; } else {E let repoType = packageJSON.repository.type.toLowerCase(),C repoUrl = packageJSON.repository.url.toLowerCase();% if (repoType !== 'git') {1 // We are looking only for Github return null; } else {C let idxOfGithubCom = repoUrl.indexOf('github.com');, if (idxOfGithubCom === -1) {8 // If the URL does not contain .com, return null; } else {* let userRepo = repoUrls .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiterp .replace(/\.git$/, '') // Replace the .git at the end with ''] .split('/'); // Split at the '/' return {* user: userRepo[0],) repo: userRepo[1] }; } } } }}module.exports = { areAppreciated, readAuthToken, findNodeModulesOnGithub, getProjectDependencies, getProjectUserRepo};5_??0v0WXf let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];5_ 0??0v0WXc let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];5_! X??0v0WX` let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];5_ "!@3??0v0W?AX8 // If the URL does not contain .com,5_!#"@>??0v0W?BX> // If the URL does not contain github.com,5_"$#A??0v0W@A //5_#%$@>??0v0W?AX> // If the URL does not contain github.com,5_$&%?+??0v0W>@X, if (idxOfGithubCom === -1) {5_%'&:$??0v0W9;X% if (repoType !== 'git') {5_&)':#??0v0W9;X$ if (repoType !== 'git') 5_'*()?+=BvW>@X+ if (idxOfGithubCom === -1) 5_)+*==M v W<NX } else {C let idxOfGithubCom = repoUrl.indexOf('github.com');, if (idxOfGithubCom === -1) {J // If the URL does not contain github.com, return null return null; } else {* let userRepo = repoUrls .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiterp .replace(/\.git$/, '') // Replace the .git at the end with ''] .split('/'); // Split at the '/' return {* user: userRepo[0],) repo: userRepo[1] }; } }5_*,+= =M v W<= } else {5_+-,:#=L v W9;W# if (repoType !== 'git')5_,.-:"=L v W9;W5_-/.=>M v W<?X return null;5_.0/@(?N v W?AY( if (idxOfGithubCom === -1) {5_/10CCM v WBNY  } else {& let userRepo = repoUrlo .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiterl .replace(/\.git$/, '') // Replace the .git at the end with ''Y .split('/'); // Split at the '/' return {& user: userRepo[0],% repo: userRepo[1] }; }5_021C CM v WBC } else {5_132C CL v WBDX5_243@DM v W?AY5_354NEN v WMN }5_465NEN v WMN }5_576#!EN v W"$X- if (!packageJSON.repository) return null;5_687#/EN v W"$X/ if (!packageJSON.repository) { return null;5_79877NvW$6OX } else {E let repoType = packageJSON.repository.type.toLowerCase(),C repoUrl = packageJSON.repository.url.toLowerCase();# if (repoType !== 'git')1 // We are looking only for Github return null;? let idxOfGithubCom = repoUrl.indexOf('github.com');& if (idxOfGithubCom === -1)F // If the URL does not contain github.com, return null return null;" let userRepo = repoUrlk .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiterh .replace(/\.git$/, '') // Replace the .git at the end with ''U .split('/'); // Split at the '/' return {" user: userRepo[0],! repo: userRepo[1] }; }5_8:977NvW&68X } else {5_9<:77NvW&68X } 5_:=;<7 7NvW(69X } 5_<>=<7OvW,;=Y if (repoType !== 'git')5_=?>>7OvW-=@Y return null;5_>@?C"7PvW/BDZ" if (idxOfGithubCom === -1)5_?A@E7PvW1DGZ return null;5_@BAQ7QvW5PQ }5_ACB77QvW668 } 5_BDC, , 2 v WD+3Z } else {. let userRepo = repoStr.split('/'); return {" user: userRepo[0],! repo: userRepo[1] }; }5_CED,, 2 v WE+, } else {5_DFE+, 1 v WF*.Y return null;5_EGF3. 3 v WH23 }5_FHGF. 3 v WZ 'use strict';#// const ghGot = require('gh-got');const fs = require('mz/fs');1const expandHomeDir = require('expand-home-dir');Bfunction areAppreciated(/* githubAuthToken, dependentModules */) {}(function findNodeModulesOnGithub(path) { if (!path) { path = './node_modules'; }}"function readAuthToken(authFile) { if (!authFile) {2 authFile = expandHomeDir('~/.appreciate'); }6 return fs.readFile(authFile).then(tokenBuffer => {' // Convert the buffer to string3 return tokenBuffer.toString('utf8').trim(); });}.function getProjectDependencies(packageJSON) {] let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];f let devDependencies = packageJSON.devDependencies ? Object.keys(packageJSON.devDependencies) : [];0 return dependencies.concat(devDependencies);}*function getProjectUserRepo(packageJSON) {1 if (!packageJSON.repository) { return null; }5 if (typeof packageJSON.repository === 'string') {- let repoStr = packageJSON.repository;* if (repoStr.indexOf(':') !== -1) {= // This means that the location is not on Github.O // As Github does not allow ':' in the names and the other services% // use it as a delimiter. return null; }* let userRepo = repoStr.split('/'); return { user: userRepo[0], repo: userRepo[1] }; } else {J if (!packageJSON.repository.type || !packageJSON.repository.url) {1 // Most likely malformed package.json return null; }A let repoType = packageJSON.repository.type.toLowerCase(),? repoUrl = packageJSON.repository.url.toLowerCase();! if (repoType !== 'git') {- // We are looking only for Github return null; }; let idxOfGithubCom = repoUrl.indexOf('github.com');$ if (idxOfGithubCom === -1) {B // If the URL does not contain github.com, return null return null; } let userRepo = repoUrlg .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiterd .replace(/\.git$/, '') // Replace the .git at the end with ''Q .split('/'); // Split at the '/' return { user: userRepo[0], repo: userRepo[1] }; }}module.exports = { areAppreciated, readAuthToken, findNodeModulesOnGithub, getProjectDependencies, getProjectUserRepo};5_GIHI=. 3 v WHJZg .substr(idxOfGithubCom + 'github.com'.length + 1) // Gobble up the github.com + 1 delimiter5_HJIH. 3 v WGJZ let userRepo = repoUrl5_IKJI. 3 v WHJ[IJ[5_JLKI). 3 v WHJ[* // Gobble up the github.com + 1 delimiter5_KMLI). 3 v WHJ[. // Gobble up the github.com + 1 delimiter5_LNMI). 3 v WHJ[2 // Gobble up the github.com + 1 delimiter5_MONK>. 3 v WJL[d .replace(/\.git$/, '') // Replace the .git at the end with ''5_NPOJ=. 3 v WIL[= .substr(idxOfGithubCom + 'github.com'.length + 1)5_OQPK. 3 v WJL\KL\5_PRQK%. 3 v WJL\&// Replace the .git at the end with ''5_QSRK%. 3 v WJL\* // Replace the .git at the end with ''5_RTSK%. 3 v WJL\. // Replace the .git at the end with ''5_SUTK. 3 v WJL\2 // Replace the .git at the end with ''5_TVUM>. 3 v WLN\Q .split('/'); // Split at the '/'5_UWVM=. 3 v WLN\5_VXWM. 3 v WLN]MN]5_WYXM. 3 v WLN]// Split at the '/'5_XZYM. 3 v WLN] // Split at the '/'5_Y[ZM. 3 v WLN] // Split at the '/'5_Z\[M . 3 v W LN] // Split at the '/'5_[]\L. 3 v W MO> .split('/'); KM> .replace(/\.git$/, '') 5_\^]L. 3 v W] 'use strict';#// const ghGot = require('gh-got');const fs = require('mz/fs');1const expandHomeDir = require('expand-home-dir');Bfunction areAppreciated(/* githubAuthToken, dependentModules */) {}(function findNodeModulesOnGithub(path) { if (!path) { path = './node_modules'; }}"function readAuthToken(authFile) { if (!authFile) {2 authFile = expandHomeDir('~/.appreciate'); }6 return fs.readFile(authFile).then(tokenBuffer => {' // Convert the buffer to string3 return tokenBuffer.toString('utf8').trim(); });}.function getProjectDependencies(packageJSON) {] let dependencies = packageJSON.dependencies ? Object.keys(packageJSON.dependencies) : [];f let devDependencies = packageJSON.devDependencies ? Object.keys(packageJSON.devDependencies) : [];0 return dependencies.concat(devDependencies);}*function getProjectUserRepo(packageJSON) {1 if (!packageJSON.repository) { return null; }5 if (typeof packageJSON.repository === 'string') {- let repoStr = packageJSON.repository;* if (repoStr.indexOf(':') !== -1) {= // This means that the location is not on Github.O // As Github does not allow ':' in the names and the other services% // use it as a delimiter. return null; }* let userRepo = repoStr.split('/'); return { user: userRepo[0], repo: userRepo[1] }; } else {J if (!packageJSON.repository.type || !packageJSON.repository.url) {1 // Most likely malformed package.json return null; }A let repoType = packageJSON.repository.type.toLowerCase(),? repoUrl = packageJSON.repository.url.toLowerCase();! if (repoType !== 'git') {- // We are looking only for Github return null; }; let idxOfGithubCom = repoUrl.indexOf('github.com');$ if (idxOfGithubCom === -1) {B // If the URL does not contain github.com, return null return null; } let userRepo = repoUrl6 // Gobble up the github.com + 1 delimiter= .substr(idxOfGithubCom + 'github.com'.length + 1)3 // Replace the .git at the end with ''" .replace(/\.git$/, '') // Split at the '/' .split('/'); return { user: userRepo[0], repo: userRepo[1] }; }}module.exports = { areAppreciated, readAuthToken, findNodeModulesOnGithub, getProjectDependencies, getProjectUserRepo};5_]_^##. 3 v W4"%]1 if (!packageJSON.repository) { return null; }5_^`_$/ 4 v W6#&^ return null; }5__a`%0 5 v W7$'_ }5_`ba#1 6 v W8#% return null; "$# if (!packageJSON.repository) { 5_acb6 6 WvWl5X`" } else {J if (!packageJSON.repository.type || !packageJSON.repository.url) {1 // Most likely malformed package.json return null; }A let repoType = packageJSON.repository.type.toLowerCase(),? repoUrl = packageJSON.repository.url.toLowerCase();! if (repoType !== 'git') {- // We are looking only for Github return null; }; let idxOfGithubCom = repoUrl.indexOf('github.com');$ if (idxOfGithubCom === -1) {B // If the URL does not contain github.com, return null return null; } let userRepo = repoUrl6 // Gobble up the github.com + 1 delimiter= .substr(idxOfGithubCom + 'github.com'.length + 1)3 // Replace the .git at the end with ''" .replace(/\.git$/, '') // Split at the '/' .split('/'); return { user: userRepo[0], repo: userRepo[1] }; }5_bdc66 WvWm56} else {5_ced5 6 VvWn48_ };5_dfeX8 XvWr WX}5_egf==8 XvW<>`= let repoType = packageJSON.repository.type.toLowerCase(),5_fhg>8 XvW=?`; repoUrl = packageJSON.repository.url.toLowerCase();5_gih>8 XvW=?`7 repoUrl = packageJSON.repository.url.toLowerCase();5_hji>8 XvW=?`3repoUrl = packageJSON.repository.url.toLowerCase();5_ikj>8 XvW!=?`7let repoUrl = packageJSON.repository.url.toLowerCase();5_jlk8 XvWL`#// const ghGot = require('gh-got');5_kml8 XvWO`Bfunction areAppreciated(/* githubAuthToken, dependentModules */) {5_lnm98 XvWQ`?function areAppreciated(githubAuthToken, dependentModules */) {5_mon<8 XvWR` // If the URL does not contain github.com, return null return null; } let userRepo = repoUrl2 // Gobble up the github.com + 1 delimiter9 .substr(idxOfGithubCom + 'github.com'.length + 1)/ // Replace the .git at the end with '' .replace(/\.git$/, '') // Split at the '/' .split('/'); return { user: userRepo[0], repo: userRepo[1] };}5_(55vW4('(5_WA< =// function areAppreciated(githubAccessToken, repositories) {//// }//+// function findNodeModulesOnGithub(path) {// if (!path) {#// path = './node_modules';// }// }5_WB<:function areAppreciated(githubAccessToken, repositories) {5_:WE)<=function areAppreciated(/* githubAccessToken, repositories) {5_+BWU**,<B packageJSON.repository.url)5_W < }5_ !W >(function findNodeModulesOnGithub(path) {5_ !W >$function findNodeModulesOnGithub() {5_ W > if (!path) {5_ W > if () {5_ W  > path = './node_modules';5_ W  > = './node_modules';5_ W  >& forProject = './node_modules';5_W  > }5_#W@#// const ghGot = require('gh-got');5_WA let nodeModulesPath = 5_ !W+ A.function findNodeModulesOnGithub(forProject) {5_ 'W/ A7function findNodeModulesOnGithub(modules, forProject) {5_ 'W/ A6function findNodeModulesOnGithub(module, forProject) {5_W35_W3 5_@W4?@ let nodeModulesPath = path.join(forProject, 'node_modules');5_@WV@@ let nodeModulesPath = path.join(forProject, 'node_modules');5_Wu moduleNames5_Wu@ Promise.all(5_Wv@@5_WwA Promise.all( moduleNames5_Wx@ Promise.all( moduleNames5_Wy@ Promise.all(moduleNames5_WA });5_WA })5_ WA }).then(5_-WB- Promise.all(moduleNames.map((module) => {5_-WC- Promise.all(moduleNames.map((module) => {5_'WD- Promise.all(moduleNames.map((module) => {5_+WD1 Promise.all(moduleNames.map((moduleName) => {5_ WD0 Promise.all(moduleNames.map((moduleName => {5_6WD6 return fs.readFile(path.join(nodeModulesPath, 5_RWDS return fs.readFile(path.join(nodeModulesPath, moduleName, 'package.json'));5_RWDR return fs.readFile(path.join(nodeModulesPath, moduleName, 'package.json'))5_RWER return fs.readFile(path.join(nodeModulesPath, moduleName, 'package.json'))5_WWF E5_PvPWFX return fs.readFile(path.join(nodeModulesPath, moduleName, 'package.json')).then(5_PvPWF let pkgJSONpath = F5_PvPWF" return fs.readFile().then(5_PPvPWFP let pkgJSONpath = path.join(nodeModulesPath, moduleName, 'package.json')5_-PvPWF- return fs.readFile(pkgJSONpath).then(5_-PvPWG- return fs.readFile(pkgJSONpath).then(5_PvPW5_-PvPWG- return fs.readFile(pkgJSONpath).then(5_PvPWH } );5_6PvPWG6 return fs.readFile(pkgJSONpath).then(data => {5_PvPW5_PvPW5_PvPWF return data.5_(PvPWF) return data.toString('utf8').5_PvPWF( return data.toString('utf8')5_3PvPWF3 return JSON.parse(data.toString('utf8')5_4PvPWF4 return JSON.parse(data.toString('utf8'))5_ PvPWF });5_ PvPWF }, ();5_ PvPWF }, );5_ PvPWG }, 5_ 8PvPW G;function findNodeModulesOnGithub(moduleNames, forProject) {5_PvPWG }, (err) 5_ PvPWG }, (err5_-PvPWG6 return fs.readFile(pkgJSONpath).then(data => {5_ PvPWH5 return JSON.parse(data.toString('utf8'));5_ PvPWH }, err5_PvPWH }, err5_PvPWI err5_PvPWJ err => {5_ PvPWK }).then(pkgJSONs => {5_PvPWK }).then(maybepkgJSONs => {5_PvPWK if (verbose) 5_PvPWM L5_#PvPWM4 console.error('Unable to handle 5_#PvPW M# console.error('5_,PvPWMM5_0PvPWN2 console.error('Error: ', err);5_1PvPW2 console.error('Error: ', err);5_PvPWM }5_PvPW!N }).then(maybePkgJSONs => {5_!PvPW, #O });5_!PvPW3 #P }).then(pkgJSONs => {5_ PvPW4!R !Q5_"PvPWk!$R }).then(pkgJSONs => {5_#PvPWs"$S get5_#PvPWy"$S let userRepo = get5_#PvPW"$S let userRepo = 5_#)PvPW"$S) let userRepo = getProjectUserRepo5_#*PvPW"$S+ let userRepo = getProjectUserRepo()5_#3PvPW"$S3 let userRepo = getProjectUserRepo(userRepo)5_$PvPW#$5_!2PvPW "R7 return maybePkgJSONs.filter(x => { return x });5_!5PvPW "R9 return maybePkgJSONs.filter(x => { return !!x });5_#4PvPW"%R4 let userRepo = getProjectUserRepo(userRepo);5_!$PvPW "S: return maybePkgJSONs.filter(x => { return !!x; });5_!$PvPW "S& return maybePkgJSONs.filter();5_###vW"$S4 let userRepo = getProjectUserRepo(userRepo);5_###vW"$S% getProjectUserRepo(userRepo);5_$##vW#$5_#4##vW"$R5 return pkgJSONs.getProjectUserRepo(userRepo);5_#4##vW"$R4 return pkgJSONs.getProjectUserRepo(userRepo)5_ ###vW"%RE return pkgJSONs.getProjectUserRepo(userRepo).filter(Boolean);5_  ###vW"$S return pkgJSONs.map(9 getProjectUserRepo(userRepo).filter(Boolean);5_   ###vW"$RJ return pkgJSONs.map( getProjectUserRepo(userRepo).filter(Boolean);5_   #.##vW"$RI return pkgJSONs.map(getProjectUserRepo(userRepo).filter(Boolean);5_   #/##vW"$RJ return pkgJSONs.map(getProjectUserRepo)(userRepo).filter(Boolean);5_  ##vW+ }, 5_ ##vW,R/ Promise.all(moduleNames.map(moduleName => {5_###vW "$S "$R5_#$$vWv"$S // Get 5_ $$vW| T  S5_vW T if (!forProject) { forProject = '.'; }5_vWQ, // Ignore all the nulls in the code.5_vWQ // Ignore all the 5_7vWQ8 // Ignore all the failures to read package.jsons5_7vWQ7 // Ignore all the failures to read package.json5_!vW "Q // Extract only 5_vWQ9 return JSON.parse(data.toString('utf8'));5_?vWR? pkgJSON: JSON.parse(data.toString('utf8'));5_vWS return {5_"$vW!#T- return maybePkgJSONs.filter(Boolean);5_%vW$'T@ return pkgJSONs.map(getProjectUserRepo).filter(Boolean);5_&vW%(U0 getProjectUserRepo).filter(Boolean);5_&vW%)W %'V5_ (vW')Y githubInfo:  getProjectUserRepo5_! (.vW')X. githubInfo: getProjectUserRepo5_ "!(9vW'*X9 githubInfo: getProjectUserRepo(x.pkgJSON)5_!#"*vW)+Y ).filter(Boolean);5_"$#*vW)+Y ).filter();5_#%$) vW(*Y };5_$&%$vW-#%, // Extract only those modules which 5_%'&) vW (+Y }5_&('*vW .)+Z }2 ).filter(x => { return !!x.githubInfo; });5_')(vW&Y }5_(*)$+vW8/#&Y+ // Extract only those modules which5_)+*3vW0ZE console.error('Error: ', err, ' Ignoring file.');5_*,+ vW1!Z }).then(maybePkgJSONs => {5_+-,+vW4*-Z3 }).filter(x => { return !!x.githubInfo; });5_,.-,#vW6+.[& return !!x.githubInfo; });5_-/.+vW72+-# return !!x.githubInfo; *, }).filter(x => { 5_.0/,vWG+-\" return !!x.githubInfo;5_/10,vWG+-\! return !x.githubInfo;5_021,vWG+-\ return x.githubInfo;5_182,'vWJ3+-\( return Boolean(x.githubInfo;5_2938vWx\ return null;5_8:9vWy\ return 5_9;:vWz ] return {5_:<;vW `  _5_;=<5vW `5 error: 'package.json not found.',5_<>= vW4 ! pkgJSON: null5_=?>$ vW#$> // Ignore all the failures to read package.json files.5_>@?$ vW#$- return maybePkgJSONs.filter(Boolean);5_?A@$ vW#$ }).then(pkgJSONs => {5_@BA'vW#&(] &(\5_ACB((+vW+',] return {) moduleName: x.moduleName,9 githubInfo: getProjectUserRepo(x.pkgJSON) };5_BDC+(+vW.*,] };5_CED+(+vW2*-] }5_DFE((+vW8')_ ')^5_EGF(!),vWL')_! let githubInfo = 5_FHG+ + +<v<WP*,_= githubInfo: getProjectUserRepo(x.pkgJSON)5_GIH(+ +<v<WQ')_! let githubInfo = ()_5_HJI(=+ +<v<WR')_> let githubInfo =getProjectUserRepo(x.pkgJSON) 5_IKJ( + +<v<WS')_? let githubInfo =getProjectUserRepo(x.pkgJSON); 5_JLK+ + +<v<WU*,_ githubInfo: 5_KML)+ +<v<WW(,` (*_5_LNM)". .<v<Wc(,b" if (!githubInfo) {5_MON*0 0<v<We)-d return {5_NPO,C2 2<v<Wv+-fC error: 'Could not find a Github repository.5_OQP, 2 2<v<Wx+-fD error: 'Could not find a Github repository.'5_PSQ, 2 2<v<Wx+-f? error: ' not find a Github repository.'5_QTRS, 2 2<v<Wz+-f> error: 'not find a Github repository.'5_SUT,$2 2<v<W{+-f> error: 'Not find a Github repository.'5_TVU,$2 2<v<W{+-f: error: 'Not a Github repository.'5_UWV-2 2<v<W},.f }5_VXW42 2<v<W345_WYX32 2<v<W26e };5_XZY42 2<v<W35g } else {5_Y[Z5 2 2<v<W45 }5_Z\[5 2 2<v<W47g 46f5_[]\52 2<v<W455_\^]6 6 8 v W57g }).filter(x => {) return Boolean(x.githubInfo); });5_]_^)6 6v W(*e5_^`_(7 7v W5')@ let githubInfo = getProjectUserRepo(x.pkgJSON); 5__a` 7 7v W!f }5_`ba&7 7v W%'f" return pkgJSONs.map(x => {5_acb&7 7v W%'f' return maybepkgJSONs.map(x => {5_bdc7 7v W6f5_ced8 8 v W g@function areAppreciated(/* githubAccessToken, repositories */) {5_dfe78 8 v W g=function areAppreciated(githubAccessToken, repositories */) {5_egf+8 8 v W g:function areAppreciated(githubAccessToken, repositories) {5_fhg+8 8 v W g.function areAppreciated(githubAccessToken, ) {5_gih 8 8 v W h  g5_hji<9 9 v W h > v W8 n  m5_npo ? ? v WH  let 5_oqp <> > v WI m@ @ v Ws o> return Promise.all(moduleRepoInfos.map(moduleRepoInfo => {5_wyx=B B v W q= return ghGot(isStarredURL(moduleRepoInfo.githubInfo),5_xzy =B B v W q=function areAppreciated(githubAccessToken, moduleRepoInfos) {5_y{z>C C v Wr> return ghGot(isStarredURL(moduleRepoInfo.githubInfo), 5_z|{C C v W5_{}|B B v W ghGot('/user/starred/5_|~}A A v W githubAccessToken5_}~@ @ v Wo });5_~A A v W5_ @ @ v Wo }).then(5_A A v Wq p5_'B B v WqD return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts);5_HB B v WqH return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts);5_E E v Wu t5_+F F v Wu+ // The moduleRepoInfo has an error.5_ F F v Wu }).then(5_G G v W5_F F v W }5_E E v Wt }).then(resp => {5_F F v W5_E E v Wt }).then(resp => {5_F F v Wu } )5_E E v Wt })5_F F v W!u }).catch(err => {5_G G v W&w v5_H H v Wkw if (err.statusCode5_%I I v Wzx% if (err.statusCode === 404) {5_K K v W}z return {5_(L L v W{( moduleName: x.moduleName5_M M v W| starred: true,5_M M v W|5_N N v W5_M M v W} |5_N N v W}5_O O v W!~ return 5_P P v W! return {5_HQ Q v WH return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts);5_GQ Q v W M return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts).then(5_R R v W  .then(5_R R v W  .then(5_S S v W # .then(resp => {5_T T v W ! resp => { },5_!S S v W $ resp => { },5_#S S v W # resp => {},5_!U U v W 4# resp => {},5_!V V v W 5! resp => {5_#X X v W A$ return { }5_#W W v W B# return 5_#W W v W # return 5_ W W v W ! err => {}5_W W v W  err => {5_W W v W  err => 5_ X X v W  err => {5_9Z Z v W 9 if (err.statusCode === 404) {5_[ [ v W  }5_ ] ] v W ( if (moduleRepoInfo.githubInfo) {5_] ] v W ) if (!moduleRepoInfo.githubInfo) {5_] ] v W  if (!moduleRepoInfo.) {5_vW   .then(! resp => {K return Object.assign({}, x, { starred: true }); }, err => {9 if (err.statusCode === 404) {P return Object.assign({}, x, { starred: false }); }H return Object.assign({}, x, { error: err }); } );5_!!- v W  " }).then(resp => { }).catch(err => {% if (err.statusCode === 404) { return {) moduleName: x.moduleName,) githubInfo: x.githubInfo, starred: true }; } return { moduleName: x.module } });5_!!!v W  " }) });5_!!!v W  " })5_!!!v W!7 " });5_!!v W"P#// const ghGot = require('gh-got');5_!!v W"P"/ const ghGot = require('gh-got');5_!!v W"Q8! const ghGot = require('gh-got');5_!!v W"[const path = require('path');5_  v W"\~~5_!!v W"]const fs = require('mz/fs');5_  v W"^~~5_!!v W"_9const path = require('path');5_""v W"|const fs = require('mz/fs');5_!!v W"|5_""v W":5_9!!v W"L return Object.assign({}, x, { starred: false });5_G!!v W"K return Object.assign({}, x, {starred: false });5_C!!v W"G return Object.assign({}, x, { starred: true });5_5!!v W"F return Object.assign({}, x, { starred: true});5_1!!v W"E return Object.assign({}, x, {starred: true});5_1!!v W"D return Object.assign({}, , {starred: true});5_5!!v W"J return Object.assign({}, x, {starred: false});5_5!!v W"I return Object.assign({}, , {starred: false});5_@!!v W"D return Object.assign({}, x, { error: err });5_5!!v W"C return Object.assign({}, x, { error: err});5_1!!v W"B return Object.assign({}, x, {error: err});5_1!!v W";A return Object.assign({}, , {error: err});5_ )!!v W" , let opts = { token: githubAccessToken };5_ !!v W"< + let opts = { token: githubAccessToken};5_!!v W" resp => {5_!!v W"= => {5_ !!v W'> F return '/user/starred/' + githubInfo.user + '/' + githubInfo.repo;5_ W }5_ ;W ;function isAppreciated(githubAccessToken, moduleRepoInfo) {5_ +W + const opts = {token: githubAccessToken}5_W 5_ ,W , const opts = {token: githubAccessToken};5_W () => {5_W }5_W 5_1W1 if (err.statusCode === 404) {5_W }5_W }5_W5_ W $ if (!moduleRepoInfo.error) {5_ W  5_W $ if (!moduleRepoInfo.error) {5_vW ? return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts) .then( () => {N return Object.assign({}, moduleRepoInfo, {starred: true}); }, err => {1 if (err.statusCode === 404) {S return Object.assign({}, moduleRepoInfo, {starred: false}); }J return Object.assign({}, moduleRepoInfo, {error: err}) } );5_vW );5_ vW  } else {5_44vW- return Promise.resovle(5_.55vW.. return Promise.resovle(moduleRepoInfo;5_55vW05_#=#=1vW7"$> return Promise.all(moduleRepoInfos.map(moduleRepoInfo => {G return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts) .then( () => {R return Object.assign({}, moduleRepoInfo, {starred: true}); }, err => {5 if (err.statusCode === 404) {W return Object.assign({}, moduleRepoInfo, {starred: false}); }O return Object.assign({}, moduleRepoInfo, {error: err}); } ); }5_$#=#EvW:#$5_$#=#EvW>#$: // The moduleRepoInfo has an error embedded in it.5_#=#EvW?5_%$=$EvWA$% return moduleRepoInfo;5_%$=$EvWC$% }));5_$=$=$EvWE#%= return Promise.all(moduleRepoInfos.map(moduleRepoInfo => 5_$=$=$EvWR#&\ return Promise.all(moduleRepoInfos.map(moduleRepoInfo => isAppreciated(githubAccessToken5_%'$=$EvWT$'' isAppreciated(githubAccessToken5_&$=$EvWY?%' }(;5_&$=$EvWe@%' });5_$=$>vWA~ ~5_$=$>vW./ return Promise.resovle(moduleRepoInfo);5_$=$>vW/C. return Promise.resole(moduleRepoInfo);5_$=$>vWR  if (!moduleRepoInfo.error) {5_$=$>vWT: // The moduleRepoInfo has an error embedded in it./ return Promise.resolve(moduleRepoInfo);5_"=">vWU5_/$=$>vWV/ return Promise.resolve(moduleRepoInfo);5_ vW[  } else { }}5_ vW\D! }}5_ vWw } else {5_vWz C return ghGot(isStarredURL(moduleRepoInfo.githubInfo), opts) .then( () => {R return Object.assign({}, moduleRepoInfo, {starred: true}); }, err => {5 if (err.statusCode === 404) {W return Object.assign({}, moduleRepoInfo, {starred: false}); }N return Object.assign({}, moduleRepoInfo, {error: err}) } );5_vW{5_ vW}E  }5_JvWJ return Object.assign({}, moduleRepoInfo, {error: err})5_#vW"#* let opts = {token: githubAccessToken};5_$vWF#%9 isAppreciated(githubAccessToken, moduleRepoInfo);5_~vWG} }5_ HvWwK return Object.assign({}, moduleRepoInfo, {error: err});5_  =vWm return Object.assign({}, moduleRepoInfo, {error: err.statusMessage || 'Unknown error.'});5_   ) vW= return Object.assign({}, moduleRepoInfo, 5_   !vW , {}, moduleRepoInfo, 5_   F"vW"H {error: err.statusMessage || 'Unknown error.'});5_  #vWH ( moduleRepoInfo, 5_ 0#vWS return Object.assign({}, moduleRepoInfo, {starred: false});5_-$vW0 return Object.assign({},5_,%vW> moduleRepoInfo, {starred: false});5_,&vW. {starred: false});5_'vWI, moduleRepoInfo, 5_'vW5_(vWJ5_0'vW$K 5_*(vW:/ console.log('err = ', err);5_) v WOZ console.log('err = ', moduleRepoInfo.githubInfo.repo, ' err = ', err);5_^W h]b}5_`W _a&function getUniqueRepos(moduleInfos) {5_`W _a(function getUniqueRepos(mbmoduleInfos) {5_`(W _b(function getUniqueRepos(mbModuleInfos) {5_`(W _b(function getUniqueRepos(mbModuleInfos) {5_ aW `b. // Returns the modules which have a unique5_! aW `b // 5_ "!a2W `c2 // Keep only one module name for a repository.5_!#"aW `b2 // Keep only one module name for a repository.5_"$#aW `b- // Keep only one module for a repository.5_#%$a$W `b1 // Keep only one moduleInfo for a repository.5_$&%a$W `b0 // Keep only one moduleInfo for repository.5_%'&a3W `c3 // Keep only one moduleInfo for one repository.5_&('bW ac- // This allows multiple modules to have t5_')(bW ad // 5_(*)cW bf // See #2.5_)+*fW ef5_*,+fW ef5_+-, dW }5_,.- fW  5_-/.pW5_.0/oWP5_/10mWWlp // See #2.5_021pWioq# return mbModuleInfos.map(x => {5_132pWjoq mbModuleInfos.map(x => {5_243pWkoq mbModuleInfos.map(x => {5_354pWkoq mbModuleInfos.(x => {5_465p Wmor mbModuleInfos.forEach(x => {5_576lMW}knM // This is because more than one module can point to the same repository.5_687mWln& // The module chosen is arbitrary.5_798mWln // 5_8:9sWQrv });5_9;:W getProjectUserRepo5_:<;W uni5_;=<WR 5_<>=rWISqs% uniqueModule[getName(x)] = x;5_=?>uWRtv* return Object.values(uniqueModuleMap);5_>@?uWStv$ return Object.(uniqueModuleMap);5_?A@u'WUtv( return Object.keys(uniqueModuleMap);5_@BAuCW^tvF return Object.keys(uniqueModuleMap).map(x => uniqueModuleMap[x];);5_ACBu1W`TtvE return Object.keys(uniqueModuleMap).map(x => uniqueModuleMap[x]);5_BDCu1WxtvL return Object.keys(uniqueModuleMap).map(x => return uniqueModuleMap[x]);5_CEDu1WxVtvF return Object.keys(uniqueModuleMap).map(x => uniqueModuleMap[x]);5_DFE W  }5_EGF $W  $function getAppreciateModuleInfo() {5_FHG W   return {5_GIHW W githubInfo: {5_HJIW X }5_IKJW!f getUniqueRepos5_JKW!Y getUniqueRepos,5_zCWNy{C packageJSON.repository.url);5_ ) v WMLP console.log(moduleRepoInfo.githubInfo.repo, ' err = ', err);5_$#=#EvW;#%5_$#=#EvW;#%5_$#=#EvW<#% ));5_ ;""v W"h  {C return Object.assign({}, x, { starred: true }); }, err => {1 if (err.statusCode === 404) {H return Object.assign({}, x, { starred: false }); }@ return Object.assign({}, x, { error: err }); } );5_QSR, 2 2<v<Wy+-f= error: 'ot find a Github repository.'5_2483vWc \=function areAppreciated(githubAccessToken, repositories */) {5_3547vWe \:function areAppreciated(githubAccessToken, repositories) {5_465:vWf \:function areAppreciated(githubAccessToken, repositories) {5_576vWo] const ghGot = require('gh-got');5_67 vWq 5_PvPWK }).then(pkgJSONs => { }5_,// vW+-YG packageJSON.repository.url)5_:<;77NvW'68X } 5_')(==">"v"W<>5_CC??0v0WHBDUC let userRepo = repoUrl.substr(idxOfGithubCom + R 'github.com'.length + 1).replace(/\.git$/, '').split('/');5_%%%(v(W$-5_0vW''8 let devDependencies =packageJSON.dependencies || [];5_vW"# const ghGot = require('gh-got');5_~ vW!5_npo)vW=function areAppreciated(githubAuthToken, Dependent_modules) {5_`ba vW *function findNode_odules_on_github(path) {5_JLKvWڰ;5