{"_id":"relative","_rev":"55017","name":"relative","description":"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.","dist-tags":{"latest":"3.0.2"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2021-06-03T10:16:45.000Z","created":"2014-02-02T09:39:46.727Z","3.0.2":"2015-11-12T06:53:57.116Z","3.0.1":"2015-07-09T09:11:48.457Z","3.0.0":"2015-04-06T03:24:27.652Z","2.0.0":"2015-02-21T02:29:55.812Z","1.2.0":"2014-12-25T19:51:30.458Z","1.1.0":"2014-12-20T19:29:01.614Z","1.0.1":"2014-11-17T07:55:33.387Z","1.0.0":"2014-11-17T07:53:57.436Z","0.1.6":"2014-07-06T13:07:14.479Z","0.1.5":"2014-07-06T12:44:56.520Z","0.1.4":"2014-04-20T10:01:15.790Z","0.1.3":"2014-04-05T01:52:41.336Z","0.1.2":"2014-02-08T20:28:57.052Z","0.1.1":"2014-02-08T20:20:59.310Z","0.1.0":"2014-02-02T09:39:46.727Z"},"users":{"zachleat":true},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/relative.git"},"versions":{"3.0.2":{"name":"relative","description":"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.","version":"3.0.2","homepage":"https://github.com/jonschlinkert/relative","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"dependencies":{"isobject":"^2.0.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"verb":{"related":{"list":["cwd","export-files","is-absolute","is-relative","is-dotfile","global-prefix"]}},"gitHead":"c140ab47217f9410365e0239c3aebab9e095a0c2","_id":"relative@3.0.2","_shasum":"0dcd8ec54a5d35a3c15e104503d65375b5a5367f","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"0dcd8ec54a5d35a3c15e104503d65375b5a5367f","size":3718,"noattachment":false,"key":"/relative/-/relative-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-3.0.2.tgz"},"directories":{},"publish_time":1447311237116,"_cnpm_publish_time":1447311237116,"_hasShrinkwrap":false},"3.0.1":{"name":"relative","description":"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.","version":"3.0.1","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^2.1.0","should":"^5.0.0"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"gitHead":"739150fb1606b4c92f42f4575b9ea559d4ad7507","homepage":"https://github.com/jonschlinkert/relative#readme","_id":"relative@3.0.1","_shasum":"4bc3ac174e28bcba7dc757fcc9a9b19bc0aa2b85","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"4bc3ac174e28bcba7dc757fcc9a9b19bc0aa2b85","size":3627,"noattachment":false,"key":"/relative/-/relative-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-3.0.1.tgz"},"directories":{},"publish_time":1436433108457,"_cnpm_publish_time":1436433108457,"_hasShrinkwrap":false},"3.0.0":{"name":"relative","description":"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.","version":"3.0.0","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^2.1.0","should":"^5.0.0"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"gitHead":"cd81e5244ad4d502cb8a0881e1907d54d0813aec","homepage":"https://github.com/jonschlinkert/relative","_id":"relative@3.0.0","_shasum":"572ef0c9f0026d7b45235abdc934a4c0ffa4bfc0","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"572ef0c9f0026d7b45235abdc934a4c0ffa4bfc0","size":3543,"noattachment":false,"key":"/relative/-/relative-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-3.0.0.tgz"},"directories":{},"publish_time":1428290667652,"_cnpm_publish_time":1428290667652,"_hasShrinkwrap":false},"2.0.0":{"name":"relative","description":"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.","version":"2.0.0","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">= 0.8.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"^2.1.0","should":"^5.0.0"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"gitHead":"a5297e1930ebb5ce15939aa8d40f21d0d6fee1c8","homepage":"https://github.com/jonschlinkert/relative","_id":"relative@2.0.0","_shasum":"44d701110045eb58bc77c415831f231de7bf1830","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"44d701110045eb58bc77c415831f231de7bf1830","size":3161,"noattachment":false,"key":"/relative/-/relative-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-2.0.0.tgz"},"directories":{},"publish_time":1424485795812,"_cnpm_publish_time":1424485795812,"_hasShrinkwrap":false},"1.2.0":{"name":"relative","version":"1.2.0","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"},"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"gitHead":"fa5e3d858e6c2a12bc441c3af35897caf3c27f02","homepage":"https://github.com/jonschlinkert/relative","_id":"relative@1.2.0","_shasum":"3d3a585c1ce74a7ac9e603eae17d122f160940eb","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"3d3a585c1ce74a7ac9e603eae17d122f160940eb","size":3109,"noattachment":false,"key":"/relative/-/relative-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-1.2.0.tgz"},"directories":{},"publish_time":1419537090458,"_cnpm_publish_time":1419537090458,"_hasShrinkwrap":false},"1.1.0":{"name":"relative","version":"1.1.0","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"},"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["absolute","calculate","file","filepath","fs","normalize","path","path-relative","relative","resolve"],"gitHead":"2db7bd89bc1573f89c4375a779a1692ecab28def","homepage":"https://github.com/jonschlinkert/relative","_id":"relative@1.1.0","_shasum":"0b4771f05ff0fdd97b444d0b374f511739d7b795","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"0b4771f05ff0fdd97b444d0b374f511739d7b795","size":3011,"noattachment":false,"key":"/relative/-/relative-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-1.1.0.tgz"},"directories":{},"publish_time":1419103741614,"_cnpm_publish_time":1419103741614,"_hasShrinkwrap":false},"1.0.1":{"name":"relative","version":"1.0.1","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"dependencies":{"is-directory":"^0.2.3"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1","normalize-path":"^0.3.0","should":"^4.0.4"},"keywords":["absolute","check","file","filepath","is","normalize","path","path.relative","relative","resolve","slash","slashes","uri","url"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@1.0.1","_shasum":"4adb43e73a65cc83e751aea9ab13aa4b96a53abb","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"4adb43e73a65cc83e751aea9ab13aa4b96a53abb","size":3040,"noattachment":false,"key":"/relative/-/relative-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-1.0.1.tgz"},"directories":{},"publish_time":1416210933387,"_cnpm_publish_time":1416210933387,"_hasShrinkwrap":false},"1.0.0":{"name":"relative","version":"1.0.0","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"dependencies":{"is-directory":"^0.2.3"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1","normalize-path":"^0.3.0","should":"^4.0.4"},"keywords":["absolute","check","file","filepath","is","normalize","path","path.relative","relative","resolve","slash","slashes","uri","url"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@1.0.0","_shasum":"8ff0da0c9440143b22966e54248acc0ac7031700","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"8ff0da0c9440143b22966e54248acc0ac7031700","size":3049,"noattachment":false,"key":"/relative/-/relative-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-1.0.0.tgz"},"directories":{},"publish_time":1416210837436,"_cnpm_publish_time":1416210837436,"_hasShrinkwrap":false},"0.1.6":{"name":"relative","version":"0.1.6","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1","verb-tag-jscomments":"^0.1.4"},"keywords":["absolute","check","file","filepath","is","normalize","path","path.relative","relative","resolve","slash","slashes","uri","url"],"dependencies":{"normalize-path":"^0.1.1"},"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.6","_shasum":"adc35dee5b8d3af5242bb2e6889cbcfe7a99886c","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"adc35dee5b8d3af5242bb2e6889cbcfe7a99886c","size":3103,"noattachment":false,"key":"/relative/-/relative-0.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.6.tgz"},"directories":{},"publish_time":1404652034479,"_cnpm_publish_time":1404652034479,"_hasShrinkwrap":false},"0.1.5":{"name":"relative","version":"0.1.5","description":"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.","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">= 0.8.0"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1","verb-tag-jscomments":"^0.1.4"},"keywords":["absolute","check","file","filepath","is","normalize","path","path.relative","relative","resolve","slash","slashes","uri","url"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.5","_shasum":"b7128792d07ddd8cf742926f276509d7b9131723","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"b7128792d07ddd8cf742926f276509d7b9131723","size":3089,"noattachment":false,"key":"/relative/-/relative-0.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.5.tgz"},"directories":{},"publish_time":1404650696520,"_cnpm_publish_time":1404650696520,"_hasShrinkwrap":false},"0.1.4":{"name":"relative","version":"0.1.4","description":"Easily calculate the relative path from file A to file B in Node.js project. Will calculate correctly from a file to a directory, file to file, directory to file, and directory to directory.","repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha"},"engines":{"node":">= 0.8.0"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1"},"keywords":["relative","relative path","path.relative","path"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.4","dist":{"shasum":"f758f8f1049488a59c6049bf012fbb809cf76d68","size":2813,"noattachment":false,"key":"/relative/-/relative-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.4.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1397988075790,"_cnpm_publish_time":1397988075790,"_hasShrinkwrap":false},"0.1.3":{"name":"relative","version":"0.1.3","description":"Easily calculate the relative path from file A to file B in Node.js project. Will calculate correctly from a file to a directory, file to file, directory to file, and directory to directory.","repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha"},"engines":{"node":">= 0.8.0"},"dependencies":{"fs-utils":"~0.3.0"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1"},"keywords":["relative","relative path","path.relative","path"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.3","dist":{"shasum":"cba56ab001d55bf954dc2acfff741f69ade9e47f","size":2622,"noattachment":false,"key":"/relative/-/relative-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1396662761336,"_hasShrinkwrap":false,"_cnpm_publish_time":1396662761336},"0.1.2":{"name":"relative","version":"0.1.2","description":"Easily calculate the relative path from file A to file B in Node.js project. Will calculate correctly from a file to a directory, file to file, directory to file, and directory to directory.","repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha"},"engines":{"node":">= 0.8.0"},"dependencies":{"fs-utils":"~0.3.0"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1"},"keywords":["relative","relative path","path.relative","path"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.2","dist":{"shasum":"f16829b2961d30bcab8bb574352d02775ca7f065","size":2487,"noattachment":false,"key":"/relative/-/relative-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1391891337052,"_hasShrinkwrap":false,"_cnpm_publish_time":1391891337052},"0.1.1":{"name":"relative","version":"0.1.1","description":"Easily calculate the relative path from file A to file B in Node.js project. Will calculate correctly from a file to a directory, file to file, directory to file, and directory to directory.","repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha"},"engines":{"node":">= 0.8.0"},"dependencies":{"fs-utils":"~0.2.1"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1"},"keywords":["relative","relative path","path.relative","path"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.1","dist":{"shasum":"7dae963f63952f737d6ae48f7817d68029d79d5e","size":2496,"noattachment":false,"key":"/relative/-/relative-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1391890859310,"_hasShrinkwrap":false,"_cnpm_publish_time":1391890859310},"0.1.0":{"name":"relative","version":"0.1.0","description":"Easily calculate the relative path from file A to file B.","repository":{"type":"git","url":"https://github.com/jonschlinkert/relative.git"},"bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/relative/blob/master/LICENSE-MIT"}],"main":"index.js","scripts":{"test":"mocha"},"engines":{"node":">= 0.8.0"},"dependencies":{"fs-utils":"~0.2.1"},"devDependencies":{"chai":"~1.9.0","mocha":"~1.17.1"},"keywords":["relative","relative path","path.relative","path"],"homepage":"https://github.com/jonschlinkert/relative","_id":"relative@0.1.0","dist":{"shasum":"dac6e0188922ed490ba4863bfec4412a995df949","size":2179,"noattachment":false,"key":"/relative/-/relative-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/relative/download/relative-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"directories":{},"publish_time":1391333986727,"_hasShrinkwrap":false,"_cnpm_publish_time":1391333986727}},"readme":"# relative [![NPM version](https://badge.fury.io/js/relative.svg)](http://badge.fury.io/js/relative)\n\n> 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.\n\n**Calculates correctly from:**\n\n* file-to-directory\n* file-to-file\n* directory-to-file\n* directory-to-directory\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i relative --save\n```\n\n## Usage\n\n```js\nvar relative = require('relative');\nrelative(from, to);\n\nrelative('a/b/c.txt', 'd');\n//=> '../../d'\n\nrelative('d', 'a/b/c.txt');\n//=> '../a/b/c.txt'\n```\n\nRelative to `process.cwd()`\n\n```js\nrelative('a/b/c.txt');\n//=> 'a/b/c.txt'\n\nrelative(process.cwd(), 'a/b/c.txt');\n//=> 'a/b/c.txt'\n\nrelative('a/b/c.txt', process.cwd());\n//=> '..'\n```\n\n### stat\n\nThere are cases where it is impossible to tell if a path is a file or a directory without more information.\n\n**Examples**\n\nIf assume that `a.b.c` is a directory, we have no way of know that without hitting the filesystem, which is impossible if the path doesn't actually exist.\n\nSo the result would be:\n\n```js\nrelative('fixtures/a.b.c', 'fixtures');\n//=> '.'\n```\n\n**If the path exists**\n\nPass `true` as the last argument, or pass the stat object from `fs.stat()`/`fs.statSync()` and you will get the correct result.\n\n```js\nrelative('fixtures/a.b.c', 'fixtures', true);\n//=> '..'\n```\n\n**If the path does not exist**\n\nEnd directory names with trailing slash. If you can't or don't want to do that, you may get incorrect results from time to time, but there isn't much we can do about it.\n\nOne very bad idea I had was to create a whitelist of filenames that look like directories, and directories that look like file names so that when those paths are encountered the logic would be adjusted accordingly. Anyway, it is what it is.\n\n## relative.toBase()\n\nGet the relative path to the given `base`.\n\n```js\nrelative.toBase(base, filepath);\n```\n\n**Example**:\n\n```js\nrelative.toBase('a/b', 'a/b/c/d/file.txt');\n//=> 'c/d/file.txt'\n```\n\n## Other useful libs\n\n* [cwd](https://github.com/jonschlinkert/cwd): Node.js util for easily getting the current working directory of a project based on package.json… [more](https://github.com/jonschlinkert/cwd)\n* [export-files](https://github.com/jonschlinkert/export-files): node.js utility for exporting a directory of files as modules.\n* [global-prefix](https://github.com/jonschlinkert/global-prefix): Get the npm global path prefix.\n* [is-absolute](https://github.com/jonschlinkert/is-absolute): Return true if a file path is absolute.\n* [is-relative](https://github.com/jonschlinkert/is-relative): Returns `true` if the path appears to be relative.\n* [is-dotfile](https://github.com/jonschlinkert/is-dotfile): Return true if a file path is (or has) a dotfile.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/relative/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2014-2015 Jon Schlinkert\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 09, 2015._","_attachments":{},"homepage":"https://github.com/jonschlinkert/relative","bugs":{"url":"https://github.com/jonschlinkert/relative/issues"},"license":"MIT"}