path-__dirname
Get a path in the __dirname
Note: this will not work for modules that are executed indirectly, for example testing engines like Jest.
Unlike the resolve-*
these modules allow resolution of non-module paths.
Install
npm install --save path-__dirname
yarn add path-__dirname
Import
// ES2015
// CommonJSvar dirname =
Usage
dirname([path]) : String
Get a path in the dirname.
- path {String} (optional) path to get in the dirname
Returns a string.
Example
=== __dirname //=> true //=> C:/User/Spongebob Squarepants/projects/bikini-bottom/pineapple
See also
Contributing
All pull requests and issues welcome!
If you're not sure how, check out the great video tutorials on egghead.io!
License
MIT © Sam Gluck