Socket
Book a DemoInstallSign in
Socket

relative-dest

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

relative-dest

Calculate the relative path from a file's destination path to another directory or file.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
743
63.3%
Maintainers
1
Weekly downloads
 
Created
Source

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

License

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

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

Keywords

assets

FAQs

Package last updated on 20 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts