3 var github = require('../_common/github.js');
4 var owner = 'HorseAJ86';
7 module.exports = function (request) {
8 // 1. fetch the list of releases
9 // 2. translate into the style of object that webinstall needs
10 // 3. missing / guessable pieces will be filled automatically by filename and such
11 // (in this example the github releases module does 100% of the work)
13 return github(request, owner, repo).then(function (data) {
14 var releases = data.releases;
19 "name": "shmatter-darwin-x64-1.0.0.tgz",
21 "lts": false, // long-term support release
22 "channel": "stable", // stable|rc|beta|dev
24 "download": "https://github.com/HorseAJ86/shmatter/releases/download/v1.0.0/shmatter-darwin-x64-1.0.0.tgz",
25 "os": "", // will be guessed as macos (darwin -> macos)
26 "arch": "", // will be guessed as amd64 (x64 -> amd64)
27 "ext": "" // will be guessed as tar (tgz -> tar.gz -> tar)
31 return { releases: releases };
35 if (module === require.main) {
36 module.exports(require('@root/request')).then(function (all) {
37 // limit the example output
38 all.releases = all.releases.slice(0, 5);
39 all = require('../_webi/normalize.js')(all);
40 console.info(JSON.stringify(all, null, 2));