Skip to content

Commit 4ba2866

Browse files
committed
Update readme and bump version.
1 parent 72474b9 commit 4ba2866

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@ cbin
55

66
`cbin` provides a simple interface for reading and writing binary data in JavaScript.
77

8+
Features
9+
--------
10+
11+
There are lots of similar implementations. The highlights of this one:
12+
13+
- Works in browsers and Node.js.
14+
- Small and fast.
15+
- Really nice API.
16+
- Written in TypeScript.
17+
818
Usage
919
-----
1020

1121
There are two classes, `Reader` and `Writer`, with 3 constructor parameters:
1222

1323
- `data` (required), a `Uint8Array` accessed through the class.
14-
- `pos` (optional), the current byte position (default is 0).
1524
- `endian` (optional), one of the following values:
1625
- `Endian.little` (0, the default)
1726
- `Endian.big` (1)
1827
- `Endian.native` (0 or 1 depending on the system)
28+
- `pos` (optional), the current byte position (default is 0).
1929

2030
The parameters become correspondingly named class members.
2131

@@ -49,6 +59,9 @@ const reader = new Reader(writer.data, Endian.big, 5);
4959
console.log(reader.f64());
5060
```
5161

62+
For TypeScript, a const enum values `CEndian.little` and `CEndian.big` are provided.
63+
They compile to numeric constants for a tiny size and speed improvement.
64+
5265
License
5366
=======
5467

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cbin",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "Binary data IO",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

0 commit comments

Comments
 (0)