relative-path-map
Resolves a map of paths where some paths are relative to others in the same object. Useful for describing directory structures and for project configuration.
Install
Install via npm:
npm install --save-dev relative-path-map
Examples
Simple example
var relativePathMap = ; ;
Sub-object with relative paths
;
Array with relative paths
;
Placeholder with sub-property
;
API
relativePathMap(map)
Params
object
map An object containing strings representing paths. Paths beginning with a
placeholder [<prop>]
are relative to some other path in the same object, where
<prop>
is a property name, e.g. [root]
, or a sub-property name, e.g
[root.src]
.
Returns
Type: object
Returns an object whose relative paths have been resolved.
License
Copyright © 2016 Akim McMath. Licensed under the MIT License.