2.2.1 • Published 4 years ago

fakeimg v2.2.1

Weekly downloads
267
License
MIT
Repository
github
Last release
4 years ago

Fake images generator

Build status Issue status NPM Version Downloads

When the client waits for the last moment to send the image files, and the layout is broken, you need a fake image to fill the gap.

Image providers

Example

const fakeimg = require('fakeimg')
    , fakeimg_pl = fakeimg.use('fakeimg.pl')
    , dummyimage = fakeimg.use('dummyimage')

const fakeimg_pl_object = fakeimg_pl({
  size: '400x200',
  background: '909090,255',
  foreground: 'fba,127',
  text: 'Fake image'
})

// https://fakeimg.pl/400x200/909090%2C255/fba%2C127/?text=Fake+image&font_name=yanone&font_size=50
console.log(fakeimg_pl_object.toString())

fakeimg_pl_object.download().then(http_response =>
  console.log('Fakeimg.pl download: Response status code ' + http_response.statusCode)
)

fakeimg_pl_object.downloadToFile('./fakeimg.pl.png').then(writestream =>
  console.log('Fakeimg.pl download: Writestream path', writestream.path)
)

const dummyimage_object = dummyimage({
  size: 300,
  text: 'Dummy image'
})

// https://dummyimage.com/300x300/cccccc/000000/?text=Dummy+image
console.log(dummyimage_object.toString())

dummyimage_object.download().then(http_response =>
  console.log('Dummyimage download: Response status code ' + http_response.statusCode)
)

dummyimage_object.downloadToFile('./dummyimage.png').then(writestream =>
  console.log('Dummyimage download: Writestream path', writestream.path)
)

License

MIT

2.2.1

4 years ago

2.2.0

4 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago