mjs-dirname

1.0.0 • Public • Published

mjs-dirname CI

Less verbose way to get a files __dirname and __filename in mjs files. Alternatively, one could use thrown exceptions in the helper methods to avoid providing import.meta.url as an argument, but I would prefer to avoid that. The result is as follows:

Usage

yarn add mjs-dirname
import { dirname, filename } from 'mjs-dirname';

const __dirname = dirname(import.meta.url);
const __filename = filename(import.meta.url);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.04latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.04

Package Sidebar

Install

npm i mjs-dirname

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

3.27 kB

Total Files

6

Last publish

Collaborators

  • stefanpenner