MCPcopy Create free account
hub / github.com/NativeScript/android / gitHubResponse

Function gitHubResponse

build-artifacts/scripts/release-notes.js:178–219  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

176}
177
178function gitHubResponse(f) {
179 var msg = "";
180
181 return function(res) {
182
183 console.log();
184
185 var nlTerminate = false;
186 if (res.headers['x-ratelimit-limit']) {
187 console.log("Rate limit: " + res.headers['x-ratelimit-limit']);
188 nlTerminate = true;
189 }
190 if (res.headers['x-ratelimit-remaining']) {
191 console.log("Rate remaining: " + res.headers['x-ratelimit-remaining']);
192 nlTerminate = true;
193 }
194 if (res.headers['x-ratelimit-reset']) {
195 console.log("Rate will reset: " + new Date(res.headers['x-ratelimit-reset'] * 1000));
196 nlTerminate = true;
197 }
198
199 if (nlTerminate) {
200 console.log();
201 }
202
203 res.on('data', function (d) {
204 msg += d;
205 });
206 res.on('end', function (d) {
207
208 var data = JSON.parse(msg);
209 if (data.message) {
210 console.log("Message:\n" + data.message + "\n");
211 }
212 if (data.documentation_url) {
213 console.log("Documentation:\n" + data.documentation_url + "\n");
214 }
215
216 f(data);
217 });
218 }
219}
220
221function getPassword(callback) {
222 process.stdout.write("Password: ");

Callers 2

listMilestonesFunction · 0.85
createReleaseNotesFunction · 0.85

Calls 2

logMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected