relative.to

0.0.3 • Public • Published

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.to

Usage

const relativeTo = require('relative.to');
const path = relativeTo('/root/a', '/root/b'); // b

API

relative(currentFile, distFile)

  • currentFile: {String} currentFile path
  • distFile: {String} target file that need to be calculated

Readme

Keywords

none

Package Sidebar

Install

npm i relative.to

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

2.96 kB

Total Files

5

Last publish

Collaborators

  • frozenluo