Socket
Socket
Sign inDemoInstall

asset-resolver

Package Overview
Dependencies
132
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    asset-resolver

Find an asset in a set of locations


Version published
Maintainers
1
Install size
5.11 MB
Created

Readme

Source

asset-resolver Build Status

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)
});
//=> { path: http://some.domain/assets/my.svg', mime: 'image/svg+xml', contents: ' ... ' }

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

Keywords

FAQs

Last updated on 22 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc