es-dirname

0.1.0 • Public • Published

es-dirname

Node.js module that returns the current script dirname. Similar to __dirname but also works in ES modules.

Installation

yarn add es-dirname

Usage

/path/to/the/script.mjs

import dirname from 'es-dirname'
 
console.log(dirname()) // outputs "/path/to/the"

CommonJs

console.log(require('es-dirname')() === __dirname) // true

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    14,378
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    14,378
  • 0.0.1
    1

Package Sidebar

Install

npm i es-dirname

Weekly Downloads

14,379

Version

0.1.0

License

none

Unpacked Size

1.09 kB

Total Files

4

Last publish

Collaborators

  • vdegenne