1.2.0 • Published 4 years ago

@mv-ps/placeholder v1.2.0

Weekly downloads
1
License
ISC
Repository
bitbucket
Last release
4 years ago

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
1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago