2.1.0 • Published 7 years ago

path-__dirname v2.1.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

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
import dirname from 'path-__dirname'
// CommonJS
var dirname = require('path-__dirname')

Usage

dirname([path]) : String

Get a path in the dirname.

  • path {String} (optional) path to get in the dirname

Returns a string.

Example

import dirname from 'path-__dirname'

dirname() === __dirname //=> true
dirname('pineapple') //=> 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

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago