"use strict";

const cheerio = require("cheerio");
const semver = require("semver");

const scraper = require("./scraper");

const RELEASE = /^v\d+\.\d+\.\d+\/$/;
const MIN_VERSION = "0.13.0";

scraper("http://dl.nwjs.io/")
  .then(function(body) {
    const $ = cheerio.load(body);

    const versions = $("a")
      .map(function(i, link) {
        return $(link).text();
      })
      .get()
      .filter(function(version) {
        return RELEASE.test(version);
      })
      .map(function(version) {
        return version.replace("v", "").replace("/", "");
      })
      .filter(function(version) {
        return semver.gte(version, MIN_VERSION);
      });

    versions.forEach(function(version) {
      console.log(version);
    })
  });

@@ -175,16 +175,46 @@
 ERSION =
+ process.env.MIN_NW_VERSION %7C%7C
  %220.13.0

Allow for min version to be env var.