@5app/esm-helpers
v0.0.3
Published
ESM Helper Utility functions
Downloads
521
Keywords
Readme
ESM Helpers
ESM Helpers provides shims for working with NodeJS using ESM
import {dirName, requireJSON} from 'esm-helpers';
// Recreate __dirname
const __dirname === dirName(import.meta);
// Load JSON files from a relative path
// Replaces `require('./package.json')`
const myJSON = await requireJSON(import.meta, './package.json');