require-path-relative
Like path.relative(from, to)
, but normalizes it to look good in a Node require()
statement. Also allows for an optional file entry-point.
For example:
var relative = '../' '../test.js' './utils/test.js' './'
Usage
filepath = relative(from, to, [entry])
Resolves the from
and to
directories, and optionally appends the entry
file to the end of the path.
This is handy for generating pretty-looking Node source.
License
MIT, see LICENSE.md for details.