Skip to content

gachou/image-testdata

Repository files navigation

image-testdata

NPM version Travis Build Status Coverage Status

Images for use in test-cases

Installation

npm install image-testdata

Usage

The following example demonstrates how to use this module:

const imageTestdata = require('image-testdata')
const fs = require('fs')

Promise.all([
  // Image without XMP:Identifier
  imageTestdata('no-xmp-identifier.jpg', 'tmp'),

  // Image with XMP:Identifier
  imageTestdata('with-xmp-identifier.jpg', 'tmp'),

  // Save by another name
  imageTestdata('with-xmp-identifier.jpg', 'tmp', {renameTo: 'img.jpg'})

])
  .then((files) => console.log('Return value', files))
  .then((files) => console.log('Directory listing', fs.readdirSync('tmp')))

This will generate the following output

Return value [ 'tmp/no-xmp-identifier.jpg',
  'tmp/with-xmp-identifier.jpg',
  'tmp/img.jpg' ]
Directory listing [ 'img.jpg', 'no-xmp-identifier.jpg', 'with-xmp-identifier.jpg' ]

License

image-testdata is published under the MIT-license.

See LICENSE.md for details.

Release-Notes

For release notes, see CHANGELOG.md

Contributing guidelines

See CONTRIBUTING.md.