Skip to content

stefanpenner/mjs-dirname

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published