npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

relative-dest

0.1.0

@jonschlinkert

npmHomeRepoSnykSocket
Downloads:180
$ npm install relative-dest
DailyWeeklyMonthlyYearly

relative-dest NPM version

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

  • github/jonschlinkert
  • twitter/jonschlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on December 20, 2014.