@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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.01latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.01

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