@mv-ps/placeholder

1.2.0 • Public • Published

placeholder

Create a placeholder image either at a specific size or smallest ratio.

Installation

npm i -g @mv-ps/placeholder

Usage

Command Line

$ placeholder --help
$ placeholder create [OPTIONS] <height> <width>
$ placeholder convert <imagePath>

JavaScript

const { create, convert } = require( '@mv-ps/placeholder' );

(async function() {

	let img = await create( 1920, 825, { ratio: true, color: '#f0f0f0' } );

})();

let img = convert( 'path/to/image.png' );

Examples

Convert Existing Image to Base64

$ placeholder convert /path/to/image.jpg

Transparent Image w/ Smallest Ratio

$ placeholder create 983 325 -r

Gray Hero Image w/ Smallest Ratio

$ placeholder create 1920 825 -rc '#c7c7c7'

Gray Product Card Image (exact)

$ placeholder create 382 382 -c '#c7c7c7'

Transparent Promo Image (exact)

$ placeholder create 475 678

Readme

Keywords

none

Package Sidebar

Install

npm i @mv-ps/placeholder

Weekly Downloads

4

Version

1.2.0

License

ISC

Unpacked Size

6.49 kB

Total Files

8

Last publish

Collaborators

  • mghweb
  • miva_ssoule