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);

/esm-consts/

    Package Sidebar

    Install

    npm i esm-consts

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    12.2 kB

    Total Files

    12

    Last publish

    Collaborators

    • ganeshkbhat