asset-resolver
Helper module to find an asset in a set of locations
Install
$ npm install --save asset-resolver
Usage
var resolver = require('asset-resolver');
resolver.getResource('my.svg',{
base: ['some/directory','http://some.domain/assets']
}).then(function(resource) {
console.log(resource)
});
API
resolver(input, [options])
input
Type: string
The filename
options
base
Type: string
,array
Default: [process.cwd()]
Example: ['http://domain.de/', 'http://domain.de/styles', 'app/images']
Required: false
List of directories/urls where we should start looking for assets.
CLI
$ npm install --global asset-resolver
$ asset-resolver --help
Usage
asset-resolver [input]
Options
-b --base List of directories/urls where we should start looking for assets. [Default: process.cwd()]
Examples
$ asset-resolver 'my.svg' -b 'some/directory' -b 'http://some.domain/assets'
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg>
...
</svg>
License
MIT © Ben Zörb