Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jun 3, 2024 via pnpm

etag 1.5.1

Create simple ETags
Package summary
Share
0
issues
1
license
2
MIT
Package created
18 May 2014
Version published
20 Nov 2014
Maintainers
1
Total deps
2
Direct deps
1
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
2 Packages, Including:
crc@3.2.1
etag@1.5.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

1
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
crc3.2.19.29 kBMIT
prod

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.