node-releases
node-releases copied to clipboard
Add a JavaScript module for easier access to data
While looking to implement this for nodejs/i18n, I found myself looking at what Browserlist was doing, and re-implementing it. EX:
const schedule = require(node-releases).schedule // expose the release-schedule.json object
const nodejs = require(node-releases).nodejs// expose the release-schedule.json object
Other useful functions would be to have the functions to just return active releases
I think that if we want to add JS module, we can do better and pre-generate a flat CJS/ESM modules without the need to require and parse JSON.
I did a placeholder example over in https://github.com/chicoxyzzy/node-releases/pull/21 Did you have an idea on how the generation approach would work?
fyi, there is also the possibility of using import type assertion cjs is obsolete
import { schedule } from 'node-release/data.json' assert { type: 'json' }
or for the just of simplicity export a esm file