@hint/utils-network
utils for network
Last updated 18 days ago by johnatms .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @hint/utils-network 
SYNC missed versions from official npm registry.

Network utils (@hint/utils-network)

Set of helpers for network.

Installation

This package is installed automatically when adding webhint to your project so running the following is enough:

npm install hint --save-dev

Utils

  • asPathString: Returns the pathname of a URL, normalizing depending on the platform.
  • getAsUri: Receives a string and returns a valid Uris
  • getAsUris: Receives an array of string and returns an array of valid Uris.
  • hasProtocol: Convenience function to check if a resource uses a specific protocol.
  • includedHeaders: Returns a list of all the headers in headerList that are in headers sorted alphabetically.
  • isDataURI: Convenience function to check if a resource is a data URI.
  • isHTMLDocument: Convenience function to check if a resource is a HTMLDocument.
  • isHTTP: Convenience function to check if a resource is served over HTTP.
  • isHTTPS: Convenience function to check if a resource is served over HTTPS.
  • isLocalFile: Convenience function to check if a resource is a local file.
  • isRegularProtocol: Convenience function to check if a uri's protocol is http/https if specified.
  • normalizeHeaderValue: Remove whitespace from both ends of a header value and lowercase it.
  • requestAsync: Convenience wrapper for asynchronously request an URL.
  • requestJSONAsync: Request response in the json format from an endpoint.

Current Tags

  • 1.0.4                                ...           latest (18 days ago)

5 Versions

  • 1.0.4                                ...           18 days ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           3 months ago
  • 1.0.1                                ...           6 months ago
  • 1.0.0                                ...           6 months ago

Copyright 2014 - 2016 © taobao.org |