relative.to
v0.0.3
Published
input two paths, get relative path
Readme
Description
Get relative path, based on current path.
This module could solve problems of how many ../ should I use.
Installation
npm install relative.to --save
or
yarn add relative.toUsage
const relativeTo = require('relative.to');
const path = relativeTo('/root/a', '/root/b'); // bAPI
relative(currentFile, distFile)
- currentFile: {String} currentFile path
- distFile: {String} target file that need to be calculated
