Skip to content

jamestalmage/path-thunk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Thunkified versions of popular path module functions

Resources

License

Stars

Watchers

Forks

Packages

No packages published