https://github.com/marcbachmann/resolve-basepath
`resolve-basepath` extends node's `path.resolve` with a base path feature.
https://github.com/marcbachmann/resolve-basepath
Last synced: 8 months ago
JSON representation
`resolve-basepath` extends node's `path.resolve` with a base path feature.
- Host: GitHub
- URL: https://github.com/marcbachmann/resolve-basepath
- Owner: marcbachmann
- Created: 2016-01-05T12:58:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:46:42.000Z (over 2 years ago)
- Last Synced: 2025-02-13T23:47:04.634Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# resolve-basepath
`resolve-basepath` extends node's `path.resolve` with a base path feature.
```js
// default node path.resolve
var resolve = require('resolve-basepath')
resolve('foo', 'bla') // returns '/currentdir/foo/bla'
// path.resolve with a base path
var resolve2 = require('resolve-basepath').base(__dirname)
resolve2('foo', 'bla') // returns '/directoryOfScript/foo/bla'
// path.resolve with multiple base paths
var resolve2 = require('resolve-basepath').base(__dirname, 'foo')
resolve2('bla') // returns '/directoryOfScript/foo/bla'
```