0.2.4 • Published 4 years ago
umeta v0.2.4
µmeta
A micro helper for import.meta
data.
import umeta from 'umeta';
const {dirName, fileName, require} = umeta(import.meta);
The dirName
and fileName
respectively represent __dirname
and __filename
, while the require
utility helps importing conditionally, or on demand, CommonJS friendly modules.
How to transform import.meta
for CommonJS ?
There are at least two options: