
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
generic-image-server
Advanced tools
Generic image server. You can resize or cut images, with a specific resolution passed in the url
Image server implemented with Node.js. The server provides an image and resize it maintaining its aspect ratio. You need to specify a image resolution in order to resize it.
By default, if the original image resolutions is smaller than the requested one, it cannot be extended. To force the extend, you must specify in the url a parameter force=true.
You can also crop the image with the resolution requested in the url. To do that, you need to specify a fit=true at url parameters.
You can customize the service through command line arguments:
Usage: images.js [options] pathToImageFolder
Image service
--port, -p Port number the service will listen to [number] [default: 3002]
--yMax, -y Maximum height [number] [default: 1200]
--xMax, -x Maximum width [number] [default: 1200]
Redis cache
--cache, -c Redis use [boolean] [default: true]
--redisHost, -h Redis server hostname [string] [default: "localhost"]
--redisPort, -o Redis server port [number] [default: 6379]
--redisTTL, -t Redis cache TTL [number] [default: 3600]
Opciones:
--help Show help [boolean]
With your Redis Server running:
$ npm install generic-image-server && cd node_modules/generic-image-server
$ npm install
$ node images.js --no-cache /path/to/image/repository
localhost:3002/400/400/images/image2.jpg
localhost:3002/1200/1200/images/image2.jpg?fit=true
localhost:3002/400/400/images/image2.jpg?force=true
localhost:3002/400/400/images/image2.jpg?fit=true&force=true
FAQs
Generic image server. You can resize or cut images, with a specific resolution passed in the url
The npm package generic-image-server receives a total of 0 weekly downloads. As such, generic-image-server popularity was classified as not popular.
We found that generic-image-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.