0.0.5 ā€¢ Published 1 year ago

ffv-validator v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

File format validation project is responsible to check if file contents match provided extension

šŸ  Homepage

Prerequisites

  • npm >=5.5.0
  • node >=8.0.0

Install

npm install ffv-validator

Run tests

npm run test

Example

const fs = require('fs');
const { validate } = require('ffv');

const filename = './download.jpeg';
const readStream = fs.createReadStream(filename, { highWaterMark: 512 });
const wstream = fs.createWriteStream('download-1.png');

const pass = validate('jpeg');

readStream
  .pipe(pass)
  .pipe(wstream)
  .on('error', err => {
    console.error('Pipeline failed.', err);
  })
  .on('close', () => {
    console.log('Pipeline succeeded.');
  });

Resources

Author

šŸ‘¤ Dimitris Klouvas dimitris.klouvas@gmail.com

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ā­ļø if this project helped you!

šŸ“ License

Copyright Ā© 2019 Dimitris Klouvas <dimitris.klouvas@gmail.com>. This project is MIT licensed.


This README was generated with ā¤ļø by readme-md-generator