0.1.0 • Published 2 years ago

@bzelip/dirname v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

dirname.js

ES6 __dirname utility.

This is an ES module that exposes a function that returns the equivalent of the commonjs global __dirname variable.

Install

npm install --save-dev @bzelip/dirname

API

Usage

dirname(importMetaUrl)

Returns absolute path of file.

Example:

import dirname from '@bzelip/__dirname';

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

Option

<importMetaUrl>

URL object, as returned from import.meta.url;

Author

Brian Zelip, https://zelip.me

References

LICENSE

MIT