You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

eleventy-plugin-images-responsiver

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eleventy-plugin-images-responsiver - npm Package Compare versions

Comparing version

to
3.0.0

18

eleventy-plugin-images-responsiver.js
'use strict';
const imagesResponsiver = require('images-responsiver');
import pkg from './package.json' with { type: 'json' };
module.exports = (eleventyConfig, options = {}) => {
import imagesResponsiver from 'images-responsiver';
export default async (eleventyConfig, userOptions = {}) => {
// First check if the plugin is used with a compatible version of Eleventy
try {
eleventyConfig.versionCheck(pkg['11ty'].compatibility);
} catch (e) {
console.error(
`[eleventy-plugin-image-responsiver] Plugin compatibility error ${e.message}`
);
return;
}
eleventyConfig.addTransform('imagesResponsiver', function (content) {
if (this.page.outputPath && this.page.outputPath.endsWith('.html')) {
return imagesResponsiver(content, options, this.page.url);
return imagesResponsiver(content, userOptions, this.page.url);
}

@@ -10,0 +22,0 @@ return content;

32

package.json
{
"name": "eleventy-plugin-images-responsiver",
"version": "2.2.0",
"version": "3.0.0",
"description": "Global solution for responsive images in Eleventy, allowing authors to use Markdown syntax for image and yet get responsive images in generated HTML.",

@@ -10,8 +10,9 @@ "main": "eleventy-plugin-images-responsiver.js",

},
"files": [
"./"
],
"files": [],
"type": "module",
"scripts": {
"lint": "eslint . --ext js --quiet --fix",
"prepare": "husky install"
"test": "echo \"No test specified yet\"",
"prepare": "node .husky/install.mjs",
"release": "np"
},

@@ -39,5 +40,2 @@ "keywords": [

"license": "MIT",
"peerDependencies": {
"@11ty/eleventy": "^2.0.0"
},
"dependencies": {

@@ -47,8 +45,9 @@ "images-responsiver": "^1.13.0"

"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^13.2.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^7.0.4"
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.6",
"np": "^10.0.7"
},

@@ -59,3 +58,6 @@ "bugs": {

"homepage": "https://nhoizey.github.io/eleventy-plugin-images-responsiver/",
"gitHead": "e59f7fb0422676b8928998b5233c4824ed695c10"
"gitHead": "e59f7fb0422676b8928998b5233c4824ed695c10",
"11ty": {
"compatibility": ">=3 <4"
}
}
# eleventy-plugin-images-responsiver
[![Build Status](https://github.com/nhoizey/eleventy-plugin-images-responsiver/workflows/Tests%20CI/badge.svg)](https://github.com/nhoizey/eleventy-plugin-images-responsiver/actions)
[![GitHub stars](https://img.shields.io/github/stars/nhoizey/eleventy-plugin-images-responsiver.svg?style=social)](https://github.com/nhoizey/eleventy-plugin-images-responsiver/stargazers)
[![license](https://img.shields.io/github/license/nhoizey/eleventy-plugin-images-responsiver)](https://github.com/nhoizey/eleventy-plugin-images-responsiver/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/eleventy-plugin-images-responsiver?logo=npm&style=for-the-badge)](<![npm](https://img.shields.io/npm/v/eleventy-plugin-images-responsiver?logo=npm&style=for-the-badge)>)
[![npm](https://img.shields.io/npm/dw/eleventy-plugin-images-responsiver?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/eleventy-plugin-images-responsiver)
[![GitHub stars](https://img.shields.io/github/stars/nhoizey/eleventy-plugin-images-responsiver.svg?style=for-the-badge&logo=github)](https://github.com/nhoizey/eleventy-plugin-images-responsiver/stargazers)
[![Follow @nhoizey@mamot.fr](https://img.shields.io/mastodon/follow/000262395?domain=https%3A%2F%2Fmamot.fr&style=for-the-badge&logo=mastodon&logoColor=white&color=6364FF)](https://mamot.fr/@nhoizey)

@@ -7,0 +8,0 @@ `eleventy-plugin-images-responsiver` is **a simple solution for most responsive images needs with [Eleventy](https://www.11ty.dev/)**.