# Is Text or Binary? [![Build Status](https://img.shields.io/travis/bevry/istextorbinary/master.svg)](http://travis-ci.org/bevry/istextorbinary "Check this project's build status on TravisCI") [![NPM version](https://img.shields.io/npm/v/istextorbinary.svg)](https://npmjs.org/package/istextorbinary "View this project on NPM") [![NPM downloads](https://img.shields.io/npm/dm/istextorbinary.svg)](https://npmjs.org/package/istextorbinary "View this project on NPM") [![Dependency Status](https://img.shields.io/david/bevry/istextorbinary.svg)](https://david-dm.org/bevry/istextorbinary) [![Dev Dependency Status](https://img.shields.io/david/dev/bevry/istextorbinary.svg)](https://david-dm.org/bevry/istextorbinary#info=devDependencies)
[![Gratipay donate button](https://img.shields.io/gratipay/bevry.svg)](https://www.gratipay.com/bevry/ "Donate weekly to this project using Gratipay") [![Flattr donate button](https://img.shields.io/badge/flattr-donate-yellow.svg)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") [![PayPayl donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") [![BitCoin donate button](https://img.shields.io/badge/bitcoin-donate-yellow.svg)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin") [![Wishlist browse button](https://img.shields.io/badge/wishlist-donate-yellow.svg)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us") Determines if a buffer is comprised of text or binary ## Install ### [NPM](http://npmjs.org/) - Use: `require('istextorbinary')` - Install: `npm install --save istextorbinary` ## Usage ``` javascript // Sync var result = require('istextorbinary').isTextSync(filename, buffer); // Async require('istextorbinary').isText(filename, buffer, function(err, result){ // ... }); // You can supply text or buffer, or both text and buffer, the more provided, the more accurate the result // isBinary, and isBinarySync methods also provided ``` ## History [Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/istextorbinary/blob/master/HISTORY.md#files) ## Contribute [Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/bevry/istextorbinary/blob/master/CONTRIBUTING.md#files) ## Backers ### Maintainers These amazing people are maintaining this project: - Benjamin Lupton (https://github.com/balupton) ### Sponsors No sponsors yet! Will you be the first? [![Gratipay donate button](https://img.shields.io/gratipay/bevry.svg)](https://www.gratipay.com/bevry/ "Donate weekly to this project using Gratipay") [![Flattr donate button](https://img.shields.io/badge/flattr-donate-yellow.svg)](http://flattr.com/thing/344188/balupton-on-Flattr "Donate monthly to this project using Flattr") [![PayPayl donate button](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QB8GQPZAH84N6 "Donate once-off to this project using Paypal") [![BitCoin donate button](https://img.shields.io/badge/bitcoin-donate-yellow.svg)](https://coinbase.com/checkouts/9ef59f5479eec1d97d63382c9ebcb93a "Donate once-off to this project using BitCoin") [![Wishlist browse button](https://img.shields.io/badge/wishlist-donate-yellow.svg)](http://amzn.com/w/2F8TXKSNAFG4V "Buy an item on our wishlist for us") ### Contributors These amazing people have contributed code to this project: - [Benjamin Lupton](https://github.com/balupton) — [view contributions](https://github.com/bevry/istextorbinary/commits?author=balupton) - [shinnn](https://github.com/shinnn) — [view contributions](https://github.com/bevry/istextorbinary/commits?author=shinnn) [Become a contributor!](https://github.com/bevry/istextorbinary/blob/master/CONTRIBUTING.md#files) ## License Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/) Copyright © 2012+ Bevry Pty Ltd (http://bevry.me)
Copyright © 2011 Benjamin Lupton (http://balupton.com)