@cruise-cli/esm-get-path
v0.0.2
Published
get __dirname, __filename in ESModule project
Downloads
3
Maintainers
Readme
@cruise-cli/esm-get-path
TODO: description
Usage
const getPath = require('@cruise-cli/esm-get-path');
// import.meta.url: /root/b/foo.js
getPath(import.meta.url)
// return '/root/b/foo.js'
getPath(import.meta.url, '..');
// '/root/b'
getPath(import.meta.url, '../package.json');
// '/root/b/package.json'