<commit_before># ![inkjet logo](images/inkjet-logo.png)

[![Build Status](https://travis-ci.org/gchudnov/inkjet.svg)](https://travis-ci.org/gchudnov/inkjet)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/gchudnov-open.svg)](https://saucelabs.com/u/gchudnov-open)

> JPEG-image decoding, encoding & EXIF reading library for a browser and node.js

## Installation

installing with npm:

```bash
npm install inkjet --save
```

## In browser

To use *inkjet* in a browser, use `inkjet.js` or `inkjet.min.js` in `/dist` directory, or build it manually:

```bash
npm install
npm run browser
```

## Usage
Decoding, encoding and EXIF extraction operations are offloaded to [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) if the environment supports them.

### Decode JPEG

```javascript<commit_msg>update CI badge<commit_after># ![inkjet logo](images/inkjet-logo.png)

![Node.js CI](https://github.com/gchudnov/inkjet/workflows/Node.js%20CI/badge.svg)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/gchudnov-open.svg)](https://saucelabs.com/u/gchudnov-open)

> JPEG-image decoding, encoding & EXIF reading library for a browser and node.js

## Installation

installing with npm:

```bash
npm install inkjet --save
```

## In browser

To use *inkjet* in a browser, use `inkjet.js` or `inkjet.min.js` in `/dist` directory, or build it manually:

```bash
npm install
npm run browser
```

## Usage
Decoding, encoding and EXIF extraction operations are offloaded to [WebWorkers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) if the environment supports them.

### Decode JPEG

```javascript
{'fraction_non_alphanumeric': 0.14547604967474867, 'fraction_numerical': 0.0011827321111768185, 'mean_word_length': 4.978798586572438, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '392796', 'n_tokens_mistral': 623, 'n_tokens_neox': 583, 'n_words': 145}