Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Apr 22, 2024 via pnpm

etag 1.8.1

Create simple HTTP ETags
Package summary
Share
0
issues
1
license
1
MIT
Package created
18 May 2014
Version published
13 Sep 2017
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
etag@1.8.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of etag 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does etag do?

The etag package is a JavaScript module that allows developers to generate HTTP ETags. ETags, as defined in RFC 7232, are essential for web optimization because they provide a mechanism for validating entities cached in a client's browser. With ETags, a client can make conditional requests to validate an entity, reducing unnecessary traffic and making for a more efficient web experience.

How do you use etag?

To use the etag package, start by installing it through the npm registry by using the npm install etag command in the terminal. In your code, you can require the package by using var etag = require('etag'). You can generate an ETag for an entity (the complete body of an entity) via etag(entity, [options]). Acceptable entities are Strings, Buffers, and fs.Stats. The 'options' parameter lets you specify whether to generate a strong or weak ETag (with the weak validator mark, the leading 'W/'). By default, 'options.weak' is false, meaning a strong ETag will be generated, unless the entity is 'fs.Stats', for which a weak ETag will be generated. A code example of setting an ETag for an HTTP response can be: res.setHeader('ETag', etag(body)).

var etag = require('etag')

// ... your application code here ...

var body = 'Hello, world!'
res.setHeader('ETag', etag(body))

Where are the etag docs?

Documentation for the etag package doesn't exist as separate documentation files or sites. Instead, all the necessary information, including the API reference and usage examples, are directly laid out in the readme file of the repository, which is accessible through its GitHub page here. For additional queries or clarifications, you can inspect the code directly or check the repository's issues for similar questions. Open-source platforms such as this support community contributions, which often include discussions and resolutions for common issues or confusions.