relative-dest
v0.1.0
Published
Calculate the relative path from a file's destination path to another directory or file.
Downloads
2,711
Maintainers
Readme
relative-dest
Calculate the relative path from a file's destination path to another directory or file.
Install with npm
npm i relative-dest --save
Usage
var relative = require('relative-dest');
relative('dist/a/b/c.md', 'dist/public');
//=> '../../public'
relative('dist/a/b/c.md', 'assets');
//=> '../../../assets'
relative('a.md', 'dist/public/css');
//=> 'dist/public/css'
relative('a/b/c/', 'a/b/c/');
//=> '.'
API
Run tests
Install dev dependencies:
node i -d && mocha
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 20, 2014.