Skip to content

Commit

Permalink
chore: expand readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fallenoak committed Nov 27, 2023
1 parent de46962 commit cc20a0e
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,48 @@
[![CI Status](https://github.com/wowserhq/io/actions/workflows/ci.yml/badge.svg)](https://github.com/wowserhq/io/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/%40wowserhq%2Fio)](https://www.npmjs.com/package/@wowserhq/io)

Wowser IO is an IO utility library for Wowser.
An IO utility library for Wowser.

## Usage

To install Wowser IO:

```sh
npm install @wowserhq/io
```

To use Wowser IO in an ES2015 module environment:

```js
import * as io from '@wowserhq/io';
```

To use Wowser IO in a CommonJS module environment:

```js
const io = require('@wowserhq/io');
```

## Example

Wowser IO provides a set of types to work with numeric, array, string, struct, and tag-length-value data formats.
Wowser's IO types permit reading and writing data.

```js
import * as io from '@wowserhq/io';

const mver = io.struct({
version: io.uint32le,
});

const rawData = new Uint8Array([0x10, 0x00, 0x00, 0x00]);
const readData = mver.read(rawData);

console.log(readData);
// { version: 16 }
```

## License

Wowser IO is copyright © Wowser Contributors. It is licensed under the **MIT** license. See
`LICENSE` for more information.

0 comments on commit cc20a0e

Please sign in to comment.