path-thunk
v1.0.1
Published
Thunkified versions of popular `path` module functions.
Downloads
3
Readme
path-thunk
Thunkified versions of popular
path
module functions.
Install
$ npm install --save path-thunk
Usage
const pathThunk = require('path-thunk');
const thunk = pathThunk.join('path/to/some/dir');
thunk('foo', 'bar.js')
//=> equivalent to path.join('path/to/some/dir', 'foo', 'bar.js');
API
pathThunk.join([path1], [path2], ...)
pathThunk.relative(from, to)
pathThunk.resolve([from ...], to)
All functions accept partial input, and return thunks for the corresponding path
methods.
pathThunk.win32
pathThunk.posix
Node 0.12 and higher only
Both have identical API's to pathThunk
, but they always return windows
or posix
paths (respectively). This mirrors the corresponding items from the path
module.
License
MIT © James Talmage