esm-consts

1.0.0 • Public • Published

esm-consts

work with esm __filepath and __dirname pathing constants in imports as in commonjs nodejs environment

Demos can be found in the folder demos

USAGE:


import { getDirname, getFilename } from "./node_module/esm-constants/src/polyfill.__dirname.regex.js";
import { default as getpaths } from "esm-consts";

const __dirname = getDirname();
console.log(__dirname);

const __filename = getFilename();
console.log(__filename);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i esm-consts

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12.2 kB

Total Files

12

Last publish

Collaborators

  • ganeshkbhat