# uchardet

> Native UChardet bindings for Node

Latest version **1.7.5** (published 2018-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install uchardet
pnpm add uchardet
yarn add uchardet
bun add uchardet
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.5 |
| Published | 2018-05-19 |
| First published | 2018-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 4 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | Kevin Chiu |
| Maintainers | icemanbeta |
| Keywords | uchardet, libuchardet, universalchardet, freedesktop, mozilla, encoding, native |

## Links

- npm: https://www.npmjs.com/package/uchardet
- Repository: https://github.com/Icemanbeta/node-uchardet
- npm.io page: https://npm.io/package/uchardet

## Dependencies (4)

- [nan](https://npm.io/package/nan.md) ^2.10.0
- [bindings](https://npm.io/package/bindings.md) ^1.3.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^3.6.2
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^1.2.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.7.5 (latest) — 2018-05-19
- 1.7.4 — 2018-05-19
- 1.7.3 — 2018-05-19
- 1.7.2 — 2018-05-19
- 1.7.1 — 2018-05-19
- 1.7.0 — 2018-05-19
- 1.6.7 — 2018-04-30
- 1.6.6 — 2018-04-27
- 1.6.5 — 2018-04-24
- 1.6.4 — 2018-04-24
- 1.6.3 — 2018-04-24
- 1.6.2 — 2018-04-24
- 1.6.1 — 2018-04-23
- 1.6.0 — 2018-04-23
- 1.5.1 — 2018-04-22
- … 2 more at https://npm.io/package/uchardet/versions

## README

# node-uchardet
> Native uchardet Binding for Node

For more information on the native binding: https://www.freedesktop.org/wiki/Software/uchardet/

## Install

### via npm
```shell
npm install -S node-uchardet@icemanbeta/uchardet
```

### via yarn
```shell
yarn add node-uchardet@icemanbeta/uchardet
```

## Usage

### Getting Started
#### CommonJS
```js
const UChardet = require('uchardet');
const uchardet = new UChardet();
const charset = uchardet.detect('/path/to/file');
```

#### ES6
```js
import * as UChardet from 'uchardet';
const uchardet = new UChardet();
const charset = uchardet.detect('/path/to/file');
```

### API
```js
detect(file)
```
* `file` [string]: Relative or absolute path to the file (**Note**: Relative path is resolved to `process.cwd()`, resolve prior if this doesn't work for you)

Example:

```js
const source = './test/resources/sample.ssa';
const charset = uchardet.detect(source);
console.log(charset);
// => TIS-620
```

```js
version()
```
Example:

```js
console.log(uchardet.version());
// => 0.0.6
```

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