srcset-generator

3.0.0 • Public • Published

srcset-generator

Travis Build Codecov Dependencies

Zero dependency srcset generator.

Install

npm i srcset-generator

Usage

import getSrcset from 'srcset-generator';
 
const srcset = getSrcset(file);

Examples

React

API

getSrcset(source, [options])

source

Type: File

The source file to generate from.

options

Type: Object

sizes

Type: Object
Default:

{
  thumb: 100,
  sm: 400,
  md: 600,
  lg: 1024,
  xl: 1280
}
output

Type string
Default: file
Options:

  • canvas
  • uri
  • file

TODO

  • Add s3 upload example
  • Add browser installation (umd script tag)
  • Add VanillaJS example
  • Add keywords to package.json

Readme

Keywords

none

Package Sidebar

Install

npm i srcset-generator

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

82.6 kB

Total Files

6

Last publish

Collaborators

  • tombonanni