import { encode } from "https://deno.land/x/etag@0.0.1/mod.ts";
Calculate an ETag value for an entity. If the entity is FileInfo
, then the
tag will default to a weak ETag. options.weak
overrides any default
behavior in generating the tag.
Examples
Example 1
Example 1
import * as etag from "https://deno.land/x/etag@0.0.1/mod.ts";
import $ from "https://deno.land/x/dax/mod.ts";
for await (const f of $.fs.expandGlob("./src/*.ts")) {
console.log(f.name);
const stat = Deno.statSync(f.path);
const tag = etag.encode(stat);
console.log(" stat:\n\t%s", JSON.stringify(stat, null, 2));
console.log(" eTag:\n\t%s", tag);
}