Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jonschlinkert/relative-dest

Calculate the relative path from a file's destination path to another directory or file. Useful in template helpers, middleware and plugins.
https://github.com/jonschlinkert/relative-dest

build dest files path relative static

Last synced: 2 months ago
JSON representation

Calculate the relative path from a file's destination path to another directory or file. Useful in template helpers, middleware and plugins.

Awesome Lists containing this project

README

        

# relative-dest [![NPM version](https://badge.fury.io/js/relative-dest.svg)](http://badge.fury.io/js/relative-dest)

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

## Install with [npm](npmjs.org)

```bash
npm i relative-dest --save
```

## Usage

```js
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:

```bash
node i -d && mocha
```

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/relative-dest/issues)

## Author

**Jon Schlinkert**

+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

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

***

_This file was generated by [verb](https://github.com/assemble/verb) on December 20, 2014._