# is-binary

> Detects if a file is binary based on its content

Latest version **0.1.0** (published 2014-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-binary
pnpm add is-binary
yarn add is-binary
bun add is-binary
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-08-09 |
| First published | 2014-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Alexandru Vladutu |
| Maintainers | alessioalex |
| Keywords | binary, is-binary, detect, detect-binary, is-binary-file, file |

## Links

- npm: https://www.npmjs.com/package/is-binary
- Repository: https://github.com/alessioalex/is-binary
- Issues: https://github.com/alessioalex/is-binary/issues
- npm.io page: https://npm.io/package/is-binary

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-08-09

## README

# is-binary

Detects if a file is binary based on its content.
[![build status](https://secure.travis-ci.org/alessioalex/is-binary.png)](http://travis-ci.org/alessioalex/is-binary)

## Usage

```js
isBinary(content)
```

Example:

```js
var assert = require('assert');
var fs = require('fs');
var isBinary = require('is-binary');

assert.equal(isBinary(fs.readFileSync('sample.pdf', 'utf8')) === false);
```

## Tests

```
npm test
```

## Inspiration

Main source code extracted from https://github.com/bevry/istextorbinary/, MIT licensed.

Tests inspired by https://github.com/gjtorikian/isBinaryFile, MIT licensed.

## License

MIT http://alessioalex.mit-license.org/

---
_Source: https://npm.io/package/is-binary · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
