Skip to content

Commit 675512c

Browse files
committed
Tweak README for 1.2.2 release
1 parent 08a0fd8 commit 675512c

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Introduction
66

7-
A set of dependency-free JavaScript modules to handle binary data in JS (using
7+
A set of dependency-free JavaScript modules to work with binary data in JS (using
88
[Typed Arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)).
99
Includes:
1010

@@ -29,10 +29,10 @@ yarn add @codedread/bitjs
2929

3030
### CommonJS/ESM in Node
3131

32-
This module is an ES Module, which should work as expected in other projects using ES Modules.
33-
However, if you are using CommonJS modules, it's a little trickier to use. One example of this is
34-
if a TypeScript project compiles to CommonJS, it will try to turn imports into require() statements,
35-
which will break. The fix for this (unfortunately) is to update your tsconfig.json:
32+
This module is an ES Module. If your project uses CommonJS modules, it's a little trickier to use.
33+
One example of this is if a TypeScript project compiles to CommonJS, it will try to turn imports
34+
into require() statements, which will break. The fix for this (unfortunately) is to update your
35+
tsconfig.json:
3636

3737
```json
3838
"moduleResolution": "Node16",
@@ -48,8 +48,8 @@ const { getFullMIMEString } = await import('@codedread/bitjs');
4848

4949
### bitjs.archive
5050

51-
This package includes objects for decompressing binary data in popular archive formats (zip, rar,
52-
tar). Here is a simple example of unrar:
51+
This package includes objects for decompressing and compressing binary data in popular archive
52+
formats (zip, rar, tar). Here is a simple example of unrar:
5353

5454
#### Decompressing
5555

@@ -65,7 +65,7 @@ unrar.addEventListener('finish', () => console.log('Done'));
6565
unrar.start();
6666
```
6767

68-
More explanation and examples are located on [the API page](./docs/bitjs.archive.md).
68+
More details and examples are located on [the API page](./docs/bitjs.archive.md).
6969

7070
### bitjs.codecs
7171

@@ -105,8 +105,10 @@ const mimeType = findMimeType(someArrayBuffer);
105105

106106
### bitjs.image
107107

108-
This package includes code for dealing with binary images. It includes low-level, event-based
109-
parsers for GIF, JPEG, and PNG images. It also includes a module for converting WebP images into
108+
This package includes code for dealing with image files. It includes low-level, event-based
109+
parsers for GIF, JPEG, and PNG images.
110+
111+
It also includes a module for converting WebP images into
110112
alternative raster graphics formats (PNG/JPG), though this latter module is deprecated, now that
111113
WebP images are well-supported in all browsers.
112114

@@ -172,7 +174,7 @@ const crc = bstream.readBits(12); // read in 12 bits as CRC, advancing the point
172174
const flagbits = bstream.peekBits(6); // look ahead at next 6 bits, but do not advance the pointer
173175
```
174176

175-
More explanation and examples are located on [the API page](./docs/bitjs.io.md).
177+
More details and examples are located on [the API page](./docs/bitjs.io.md).
176178

177179
## Reference
178180

@@ -182,7 +184,6 @@ RAR file format.
182184
## History
183185

184186
This project grew out of another project of mine, [kthoom](https://github.com/codedread/kthoom) (a
185-
comic book reader implemented in the browser). This repository was automatically exported from
187+
comic book reader implemented in the browser). This repository was automatically exported from
186188
[my original repository on GoogleCode](https://code.google.com/p/bitjs) and has undergone
187-
considerable changes and improvements since then, including adding streaming support, starter RarVM
188-
support, tests, many bug fixes, and updating the code to modern JavaScript and supported features.
189+
considerable changes and improvements since then.

archive/compress.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ import { ZipCompressionMethod, getConnectedPort } from './common.js';
2020
* @property {Uint8Array} fileData The bytes of the file.
2121
*/
2222

23-
// export const DeflateCompressionMethod = {
24-
// NO_COMPRESSION: 0,
25-
// COMPRESSION_FIXED_HUFFMAN: 1,
26-
// COMPRESSION_DYNAMIC_HUFFMAN: 2,
27-
// }
28-
2923
/**
3024
* Data elements are packed into bytes in order of increasing bit number within the byte,
3125
* i.e., starting with the least-significant bit of the byte.
@@ -51,6 +45,10 @@ export const CompressStatus = {
5145
ERROR: 'error',
5246
};
5347

48+
// TODO: Extend EventTarget and introduce subscribe methods (onProgress, onInsert, onFinish, etc).
49+
// TODO: I think appendFiles() is still a good idea so that all files do not have to live in memory
50+
// at once, but the API is wonky here... re-think it. Maybe something more like a builder?
51+
5452
/**
5553
* A thing that zips files.
5654
* NOTE: THIS IS A WORK-IN-PROGRESS! THE API IS NOT FROZEN! USE AT YOUR OWN RISK!

archive/events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class UnarchiveStartEvent extends UnarchiveEvent {
9595
/** Finish event. */
9696
export class UnarchiveFinishEvent extends UnarchiveEvent {
9797
/**
98-
* @param {Object} metadata A collection fo metadata about the archive file.
98+
* @param {Object} metadata A collection of metadata about the archive file.
9999
*/
100100
constructor(metadata = {}) {
101101
super(UnarchiveEventType.FINISH);

0 commit comments

Comments
 (0)