npm

Need private packages and team management tools?Check out npm Orgs. »

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

Keywords

install

npm i es-dirname

Downloadsweekly downloads

5

version

0.1.0

license

none

last publish

collaborators

  • avatar
Report a vulnerability