Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/jonschlinkert/relative-dest
- Owner: jonschlinkert
- License: mit
- Created: 2014-12-20T19:53:45.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-20T19:53:56.000Z (about 10 years ago)
- Last Synced: 2024-10-20T08:48:45.690Z (3 months ago)
- Topics: build, dest, files, path, relative, static
- Language: JavaScript
- Homepage: https://github.com/jonschlinkert
- Size: 102 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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._