1.0.8 • Published 10 years ago

trucks-resolver-http v1.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

HTTP Resolver

HTML import resolver for the http: and https: schemes.

Resolves HTML imports using the http: and https: schemes.

<link rel="import" href="https://example.com/components.html">

Install

npm i trucks-resolver-http --save-dev

For the command line interface see trucks-cli.



Usage

Register the http protocol plugin:

const options {
  files: ['https://example.com/components.html'],
  protocols: ['http']
}

API

HttpResolver

Resolve http: and https: protocols.

HttpResolver

public HttpResolver()

Create an HTTP resolver.

resolve

public resolve(cb)

Loads a remote HTTP resource from the network and invokes callback with the response body.

If the response has a Content-Encoding containing gzip it is deflated.

  • cb Function callback function.

http

public http(state, conf)

Plugin for the http resolver.

Registers the resolver class for the http: and https: protocols unless the secure option is given in which case the http: protocol is not registered and attempts to use http: URLs in HTML imports will generate errors.

  • state Object compiler state.
  • conf Object plugin configuration object.
Options
  • secure Boolean=false only use https:.

License

MIT


Created by mkdoc on July 22, 2016

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago