@11ty/eleventy-img
Advanced tools
Comparing version 1.1.0 to 2.0.0
14
img.js
@@ -7,3 +7,2 @@ const path = require("path"); | ||
const {default: PQueue} = require("p-queue"); | ||
const base64url = require("base64url"); | ||
const getImageSize = require("image-size"); | ||
@@ -15,3 +14,3 @@ const sharp = require("sharp"); | ||
const {RemoteAssetCache, queue} = require("@11ty/eleventy-cache-assets"); | ||
const {RemoteAssetCache, queue} = require("@11ty/eleventy-fetch"); | ||
const MemoryCache = require("./memory-cache"); | ||
@@ -132,3 +131,3 @@ | ||
duration: this.options.cacheDuration, // deprecated | ||
dryRun: this.options.dryRun, // Issue #117: re-use eleventy-img dryRun option value for eleventy-cache-assets dryRun | ||
dryRun: this.options.dryRun, // Issue #117: re-use eleventy-img dryRun option value for eleventy-fetch dryRun | ||
type: "buffer" | ||
@@ -286,3 +285,3 @@ }, this.options.cacheOptions); | ||
if(queue) { | ||
// eleventy-cache-assets 2.0.4 and up | ||
// eleventy-fetch 3.0+ and eleventy-cache-assets 2.0.4+ | ||
return queue(this.src, () => this.assetCache.fetch()); | ||
@@ -345,3 +344,8 @@ } | ||
return base64url.encode(hash.digest()).substring(0, this.options.hashLength); | ||
// Get hash in base64, and make it URL safe. | ||
// NOTE: When increasing minimum Node version to 14, | ||
// replace with hash.digest('base64url') | ||
let base64hash = hash.digest('base64').replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); | ||
return base64hash.substring(0, this.options.hashLength); | ||
} | ||
@@ -348,0 +352,0 @@ |
{ | ||
"name": "@11ty/eleventy-img", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Low level utility to perform build-time image transformations.", | ||
@@ -38,12 +38,11 @@ "publishConfig": { | ||
"dependencies": { | ||
"@11ty/eleventy-cache-assets": "^2.3.0", | ||
"@11ty/eleventy-fetch": "^3.0.0", | ||
"debug": "^4.3.3", | ||
"base64url": "^3.0.1", | ||
"image-size": "^1.0.1", | ||
"p-queue": "^6.6.2", | ||
"sharp": "^0.30.1" | ||
"sharp": "^0.30.3" | ||
}, | ||
"devDependencies": { | ||
"ava": "^4.0.1", | ||
"eslint": "^8.9.0" | ||
"ava": "^3.15.0", | ||
"eslint": "^8.11.0" | ||
}, | ||
@@ -50,0 +49,0 @@ "ava": { |
@@ -9,3 +9,3 @@ <p align="center"><img src="https://www.11ty.dev/img/logo-github.png" alt="eleventy Logo"></p> | ||
You maintain full control of your HTML—this plugin does not generate any markup. Use with `<picture>` or `<img>` or CSS `background-image`, or others! Works great to add `width` and `height` to your images! Does not require or rely on file extensions (like `.png` or `.jpg`) in URLs or local files, which may be missing or inaccurate. | ||
You maintain full control of your HTML. Use with `<picture>` or `<img>` or CSS `background-image`, or others! Works great to add `width` and `height` to your images! | ||
@@ -12,0 +12,0 @@ ## [The full `eleventy-img` documentation is on 11ty.dev](https://www.11ty.dev/docs/plugins/image/). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
744
1219652
+ Added@11ty/eleventy-fetch@^3.0.0
+ Added@11ty/eleventy-fetch@3.0.0(transitive)
- Removed@11ty/eleventy-cache-assets@^2.3.0
- Removedbase64url@^3.0.1
- Removed@11ty/eleventy-cache-assets@2.3.0(transitive)
- Removedbase64url@3.0.1(transitive)
- Removedhash-string@1.0.0(transitive)
- Removedshort-hash@1.0.0(transitive)
Updatedsharp@^0.30.3