JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 47959834
  • Score
    100M100P100Q228529F
  • License MIT

Create simple ETags

Package Exports

  • etag

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (etag) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

etag

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Create simple ETags

Installation

$ npm install etag

API

var etag = require('etag')

etag(entity, [options])

Generate a strong ETag for the given entity. This should be the complete body of the entity. Strings, Buffers, and fs.Stats are accepted. By default, a string or fs.Stats will generate a weak ETag while a Buffer will generate a strong ETag (this can be overwritten by options.weak).

res.setHeader('ETag', etag(body))

Options

etag accepts these properties in the options object.

weak

Specifies if a "strong" or a "weak" ETag will be generated. The ETag can only really be a strong as the given input.

Testing

$ npm test

License

MIT