Files
uuid/examples/node-esmodules/package.mjs
T
35b5deccfb chore: run node-esmodule package.json test only in latest node LTS (#621)
While ESM support has been stable in current versions of Node.js 14.x and 16.x, support for importing JSON files is still experimental and evolving.

Since we still want to cover the fact that the package is exporting it's package.json file, this test is now extracted to only run with the updated JSON import syntax which requires import assertions and which was introduced in Node.js 16.14.0.

Fixes #619

Co-authored-by: Robert Kieffer <[email protected]>
2022-03-17 08:42:49 +01:00

5 lines
170 B
JavaScript

import pkg from 'uuid/package.json' assert { type: 'json' };
// Some tools like react-native need to introspect the package.json file
console.log('pkg.name', pkg.name);