0.2.4 • Published 4 years ago

umeta v0.2.4

Weekly downloads
13
License
ISC
Repository
github
Last release
4 years ago

µmeta

Build Status Coverage Status

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:

  • ascjs, based on @babel/parser
  • ucjs, based on @babel/core and with minimal dependencies (compatible with dynamic import(...) too)