placeholder-img

1.0.0 • Public • Published

placeholder-img Build Status

Generates low-res blurred versions of images that can be used as placeholders while lazy-loading them.

Installation

  • npm install --save placeholder-img

Usage

  • To create a placeholder image file,
  const placeholderImg = require('placeholder-img');

  const src = 'path/to/image';
  await placeholderImg.toFile(src, /* optional destination */);

If the destination is not provided, the image will be saved to ${SRC}-placeholder.${FORMAT}.

  • To generate the placeholder image in base64 encoding,
  const placeholderImg = require('placeholder-img');

  const src = 'path/to/image';
  const base64Image = await placeholderImg.toBase64(src);

License

MIT © Sivasubramanyam A

Readme

Keywords

Package Sidebar

Install

npm i placeholder-img

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

35 kB

Total Files

10

Last publish

Collaborators

  • astronomersiva