Package Exports
- relative
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (relative) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
relative 
Get the relative filepath from path A to path B. Calculates from file-to-directory, file-to-file, directory-to-file, and directory-to-directory.
Calculates correctly from:
- File to directory
- File to file
- Directory to file
- Directory to directory
Install with npm
npm i relative --saveUsage
var relative = require('relative');
relative(from, to);
// Example
relative('test/fixtures/foo.txt', 'docs');
// => '../../docs'API
relative
Return the relative path from a to b.
from{String}to{String}returns: {String}
Example:
var relative = require('relative');
relative('a/b/foo.txt', 'c/d/file.txt');
//=> '../../c/d/file.txt'.toBase
Get the path relative to the given base path.
base{String}: The base directoryfp{String}: The full filepathreturns{String}: The relative path
Example:
relative.toBase('a/b', 'a/b/c/d/file.txt');
//=> 'c/d/file.txt'Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 25, 2014.