1.0.1 • Published 8 years ago

path-thunk v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

path-thunk Build Status

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