# @cwasm/nsbmp

> BMP decoding for Node.js, using [Libnsbmp][Libnsbmp] compiled to [WebAssembly][WebAssembly].

Latest version **0.1.3** (published 2023-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cwasm/nsbmp
pnpm add @cwasm/nsbmp
yarn add @cwasm/nsbmp
bun add @cwasm/nsbmp
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2023-07-26 |
| First published | 2019-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 31.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/@cwasm/nsbmp
- Repository: https://github.com/LinusU/cwasm-nsbmp
- Homepage: https://github.com/LinusU/cwasm-nsbmp#readme
- Issues: https://github.com/LinusU/cwasm-nsbmp/issues
- npm.io page: https://npm.io/package/@cwasm/nsbmp

## Dependencies (1)

- [@canvas/image-data](https://npm.io/package/@canvas/image-data.md) ^1.0.0

## Recent versions

- 0.1.3 (latest) — 2023-07-26
- 0.1.2 — 2020-04-13
- 0.1.1 — 2019-12-11
- 0.1.0 — 2019-11-23

## README

# BMP

BMP decoding for Node.js, using [Libnsbmp][Libnsbmp] compiled to [WebAssembly][WebAssembly].

[Libnsbmp]: https://www.netsurf-browser.org/projects/libnsbmp/
[WebAssembly]: https://webassembly.org

## Installation

```sh
npm install --save @cwasm/nsbmp
```

## Usage

```js
const fs = require('fs')
const nsbmp = require('@cwasm/nsbmp')

const source = fs.readFileSync('image.bmp')
const image = nsbmp.decode(source)

console.log(image)
// { width: 128,
//   height: 128,
//   data:
//    Uint8ClampedArray [ ... ] }
```

## API

### `decode(source)`

- `source` ([`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), required) - The BMP data
- returns [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) - Decoded width, height and pixel data

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