Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-image-placeholder

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-image-placeholder

Express router-level middleware for delivering simple test images.

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
1
Weekly downloads
 
Created
Source

express-image-placeholder

Express middleware for delivering simple test images.

Usage

Only required attributes are height and width. The are part of the route.

<your path>/:width(\d+)x:height(\d+)

Optional query attributes

  • border - Renders border. Value is true || 1 or anything else for false. Defaults to false.
  • color - Should be valid color string (https://www.npmjs.com/package/color-string). Defaults to #9E9E9E color.
  • cross - Diagonal lines. Value is true || 1 or anything else for false. Defaults to false.
  • format - Supported formats are JPG, PDF, PNG and SVG. Defaults to PNG.
  • label - Custom label fo your image. If not provided, label is WIDTH⨯HEIGHT.

Code Example

const ImagePlaceholder = require('express-image-placeholder');

app.use('/image/:width(\\d+)x:height(\\d+)', ImagePlaceholder);

Samples

Sample gray image without border and cross.

Sample blue image with border and cross.

Keywords

FAQs

Package last updated on 18 May 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc