@bzelip/dirname

0.1.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @bzelip/dirname

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

2.56 kB

Total Files

4

Last publish

Collaborators

  • bzelip