Open nschonni opened 4 years ago
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
While looking to implement this for nodejs/i18n, I found myself looking at what Browserlist was doing, and re-implementing it. EX:
Other useful functions would be to have the functions to just return active releases