项目作者: dimkl

项目描述 :
File Format Validation Project
高级语言: JavaScript
项目地址: git://github.com/dimkl/ffv.git
创建时间: 2019-09-15T17:32:47Z
项目社区:https://github.com/dimkl/ffv

开源协议:Other

下载


Welcome to ffv 👋



Version




Documentation


Maintenance


License: MIT

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

  1. npm install ffv-validator

Run tests

  1. npm run test

Example

  1. const fs = require('fs');
  2. const { validate } = require('ffv');
  3. const filename = './download.jpeg';
  4. const readStream = fs.createReadStream(filename, { highWaterMark: 512 });
  5. const wstream = fs.createWriteStream('download-1.png');
  6. const pass = validate('jpeg');
  7. readStream
  8. .pipe(pass)
  9. .pipe(wstream)
  10. .on('error', err => {
  11. console.error('Pipeline failed.', err);
  12. })
  13. .on('close', () => {
  14. console.log('Pipeline succeeded.');
  15. });

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