Update dependencies, use p-memoize

@eleventy *really* needs to support ES6 modules
pull/1/head
Starbeamrainbowlabs 2021-10-17 14:45:44 +01:00
parent 0d7cab6dd0
commit 15606bf5d7
No known key found for this signature in database
GPG Key ID: 1BE5172E637709C2
3 changed files with 110 additions and 79 deletions

166
package-lock.json generated
View File

@ -10,12 +10,13 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@11ty/eleventy": "^0.12.1", "@11ty/eleventy": "^0.12.1",
"dateformat": "^4.5.1", "dateformat": "^5.0.2",
"feedme": "^2.0.2", "feedme": "^2.0.2",
"file-type": "^16.5.3", "file-type": "^16.5.3",
"futility": "^1.1.2", "futility": "^1.1.2",
"html-entities": "^2.3.2", "html-entities": "^2.3.2",
"p-reflect": "^2.1.0", "p-memoize": "^6.0.1",
"p-reflect": "^3.0.0",
"phin": "^3.6.0", "phin": "^3.6.0",
"sha3": "^2.1.4", "sha3": "^2.1.4",
"striptags": "^3.2.0" "striptags": "^3.2.0"
@ -187,9 +188,9 @@
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
}, },
"node_modules/ansi-regex": { "node_modules/ansi-regex": {
"version": "5.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": { "engines": {
"node": ">=8" "node": ">=8"
} }
@ -289,11 +290,11 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "0.21.1", "version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.10.0" "follow-redirects": "^1.14.0"
} }
}, },
"node_modules/babel-walk": { "node_modules/babel-walk": {
@ -745,11 +746,11 @@
} }
}, },
"node_modules/dateformat": { "node_modules/dateformat": {
"version": "4.5.1", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.2.tgz",
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==", "integrity": "sha512-h9vywpuz+ReixnJTwFx5JLtZpS8eLCbRm8shwwKkCKOZA547N6yoMtD3W91Z6+NFZ8wOaZlcaCcK/w+kELhSVg==",
"engines": { "engines": {
"node": "*" "node": ">=12.20"
} }
}, },
"node_modules/debug": { "node_modules/debug": {
@ -1837,14 +1838,14 @@
} }
}, },
"node_modules/localtunnel": { "node_modules/localtunnel": {
"version": "2.0.1", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.1.tgz", "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz",
"integrity": "sha512-LiaI5wZdz0xFkIQpXbNI62ZnNn8IMsVhwxHmhA+h4vj8R9JG/07bQHWwQlyy7b95/5fVOCHJfIHv+a5XnkvaJA==", "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==",
"dependencies": { "dependencies": {
"axios": "0.21.1", "axios": "0.21.4",
"debug": "4.3.1", "debug": "4.3.2",
"openurl": "1.1.1", "openurl": "1.1.1",
"yargs": "16.2.0" "yargs": "17.1.1"
}, },
"bin": { "bin": {
"lt": "bin/lt.js" "lt": "bin/lt.js"
@ -1863,22 +1864,6 @@
"wrap-ansi": "^7.0.0" "wrap-ansi": "^7.0.0"
} }
}, },
"node_modules/localtunnel/node_modules/debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/localtunnel/node_modules/wrap-ansi": { "node_modules/localtunnel/node_modules/wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@ -1904,9 +1889,9 @@
} }
}, },
"node_modules/localtunnel/node_modules/yargs": { "node_modules/localtunnel/node_modules/yargs": {
"version": "16.2.0", "version": "17.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"dependencies": { "dependencies": {
"cliui": "^7.0.2", "cliui": "^7.0.2",
"escalade": "^3.1.1", "escalade": "^3.1.1",
@ -1917,7 +1902,7 @@
"yargs-parser": "^20.2.2" "yargs-parser": "^20.2.2"
}, },
"engines": { "engines": {
"node": ">=10" "node": ">=12"
} }
}, },
"node_modules/localtunnel/node_modules/yargs-parser": { "node_modules/localtunnel/node_modules/yargs-parser": {
@ -2082,6 +2067,17 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/mimic-fn": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
"integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -2277,12 +2273,29 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/p-reflect": { "node_modules/p-memoize": {
"version": "2.1.0", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-2.1.0.tgz", "resolved": "https://registry.npmjs.org/p-memoize/-/p-memoize-6.0.1.tgz",
"integrity": "sha512-paHV8NUz8zDHu5lhr/ngGWQiW067DK/+IbJ+RfZ4k+s8y4EKyYCz8pGYWjxCg35eHztpJAt+NUgvN4L+GCbPlg==", "integrity": "sha512-DG0wxA5fIYor0ypRltebDEZs45ZFRvgztFGv/+glYMdUCIaI9eZKIsNJ2IVihw6LYVUgfhIHtPG5XUgvN+pLtQ==",
"dependencies": {
"mimic-fn": "^4.0.0"
},
"engines": { "engines": {
"node": ">=8" "node": ">=12.20"
},
"funding": {
"url": "https://github.com/sindresorhus/p-memoize?sponsor=1"
}
},
"node_modules/p-reflect": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-3.0.0.tgz",
"integrity": "sha512-rOgYyrvUxnJdSYKGSK7UnO7RxFSnT/IJYFPiosuQ2/AtRWIryIrv8lecWqJXWbKnMcUjJvxiHDMp80m0Yj4eLA==",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/p-try": { "node_modules/p-try": {
@ -3809,9 +3822,9 @@
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8="
}, },
"ansi-regex": { "ansi-regex": {
"version": "5.0.0", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
}, },
"ansi-styles": { "ansi-styles": {
"version": "4.3.0", "version": "4.3.0",
@ -3884,11 +3897,11 @@
"integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI=" "integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI="
}, },
"axios": { "axios": {
"version": "0.21.1", "version": "0.21.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": { "requires": {
"follow-redirects": "^1.10.0" "follow-redirects": "^1.14.0"
} }
}, },
"babel-walk": { "babel-walk": {
@ -4245,9 +4258,9 @@
"integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc=" "integrity": "sha1-7S9tk9l5DOL9ZtW1/z7dW7y/Owc="
}, },
"dateformat": { "dateformat": {
"version": "4.5.1", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.2.tgz",
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==" "integrity": "sha512-h9vywpuz+ReixnJTwFx5JLtZpS8eLCbRm8shwwKkCKOZA547N6yoMtD3W91Z6+NFZ8wOaZlcaCcK/w+kELhSVg=="
}, },
"debug": { "debug": {
"version": "4.3.2", "version": "4.3.2",
@ -5064,14 +5077,14 @@
"integrity": "sha512-m1xSB10Ncu22NR3X0xdaqu/GvP1xadDCFYGqGgd6me8DAWjyA68BKE5DHJmSxw1CGsWPsX+Hj2v/87J2w/LvMQ==" "integrity": "sha512-m1xSB10Ncu22NR3X0xdaqu/GvP1xadDCFYGqGgd6me8DAWjyA68BKE5DHJmSxw1CGsWPsX+Hj2v/87J2w/LvMQ=="
}, },
"localtunnel": { "localtunnel": {
"version": "2.0.1", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.1.tgz", "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-2.0.2.tgz",
"integrity": "sha512-LiaI5wZdz0xFkIQpXbNI62ZnNn8IMsVhwxHmhA+h4vj8R9JG/07bQHWwQlyy7b95/5fVOCHJfIHv+a5XnkvaJA==", "integrity": "sha512-n418Cn5ynvJd7m/N1d9WVJISLJF/ellZnfsLnx8WBWGzxv/ntNcFkJ1o6se5quUhCplfLGBNL5tYHiq5WF3Nug==",
"requires": { "requires": {
"axios": "0.21.1", "axios": "0.21.4",
"debug": "4.3.1", "debug": "4.3.2",
"openurl": "1.1.1", "openurl": "1.1.1",
"yargs": "16.2.0" "yargs": "17.1.1"
}, },
"dependencies": { "dependencies": {
"cliui": { "cliui": {
@ -5084,14 +5097,6 @@
"wrap-ansi": "^7.0.0" "wrap-ansi": "^7.0.0"
} }
}, },
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"requires": {
"ms": "2.1.2"
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@ -5108,9 +5113,9 @@
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="
}, },
"yargs": { "yargs": {
"version": "16.2.0", "version": "17.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
"integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"requires": { "requires": {
"cliui": "^7.0.2", "cliui": "^7.0.2",
"escalade": "^3.1.1", "escalade": "^3.1.1",
@ -5245,6 +5250,11 @@
"mime-db": "1.49.0" "mime-db": "1.49.0"
} }
}, },
"mimic-fn": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz",
"integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw=="
},
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -5381,10 +5391,18 @@
"p-limit": "^2.2.0" "p-limit": "^2.2.0"
} }
}, },
"p-memoize": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/p-memoize/-/p-memoize-6.0.1.tgz",
"integrity": "sha512-DG0wxA5fIYor0ypRltebDEZs45ZFRvgztFGv/+glYMdUCIaI9eZKIsNJ2IVihw6LYVUgfhIHtPG5XUgvN+pLtQ==",
"requires": {
"mimic-fn": "^4.0.0"
}
},
"p-reflect": { "p-reflect": {
"version": "2.1.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-2.1.0.tgz", "resolved": "https://registry.npmjs.org/p-reflect/-/p-reflect-3.0.0.tgz",
"integrity": "sha512-paHV8NUz8zDHu5lhr/ngGWQiW067DK/+IbJ+RfZ4k+s8y4EKyYCz8pGYWjxCg35eHztpJAt+NUgvN4L+GCbPlg==" "integrity": "sha512-rOgYyrvUxnJdSYKGSK7UnO7RxFSnT/IJYFPiosuQ2/AtRWIryIrv8lecWqJXWbKnMcUjJvxiHDMp80m0Yj4eLA=="
}, },
"p-try": { "p-try": {
"version": "2.2.0", "version": "2.2.0",

View File

@ -22,12 +22,13 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@11ty/eleventy": "^0.12.1", "@11ty/eleventy": "^0.12.1",
"dateformat": "^4.5.1", "dateformat": "^5.0.2",
"feedme": "^2.0.2", "feedme": "^2.0.2",
"file-type": "^16.5.3", "file-type": "^16.5.3",
"futility": "^1.1.2", "futility": "^1.1.2",
"html-entities": "^2.3.2", "html-entities": "^2.3.2",
"p-reflect": "^2.1.0", "p-memoize": "^6.0.1",
"p-reflect": "^3.0.0",
"phin": "^3.6.0", "phin": "^3.6.0",
"sha3": "^2.1.4", "sha3": "^2.1.4",
"striptags": "^3.2.0" "striptags": "^3.2.0"

View File

@ -1,8 +1,6 @@
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const pReflect = require("p-reflect");
const dateformat = require("dateformat");
const striptags = require("striptags"); const striptags = require("striptags");
const fetch_feed = require("./lib/fetch_feed.js"); const fetch_feed = require("./lib/fetch_feed.js");
@ -14,7 +12,10 @@ const DESCRIPTION_LENGTH = 200;
global.feed_items = null; global.feed_items = null;
global.feed_authors_error = null; global.feed_authors_error = null;
module.exports = async function() { async function do_feeds() {
const pReflect = (await import("p-reflect")).default;
const dateformat = (await import("dateformat")).default;
if(global.feed_items === null) { if(global.feed_items === null) {
const feeds = JSON.parse(await fs.promises.readFile("../feeds.json", "utf-8")); const feeds = JSON.parse(await fs.promises.readFile("../feeds.json", "utf-8"));
@ -105,3 +106,14 @@ module.exports = async function() {
} }
}; };
} }
var do_feeds_memoized = null;
module.exports = async function() {
if(do_feeds_memoized == null) {
const pMemoize = (await import("p-memoize")).default;
do_feeds_memoized = pMemoize(do_feeds);
}
return await do_feeds_memoized();
}