Remove unnecessary wrapping of functionality in a class

This commit is contained in:
Michael Smith
2023-05-31 20:49:44 +02:00
parent bd68eb6940
commit f937499e6f
4 changed files with 220 additions and 248 deletions

View File

@@ -19,14 +19,14 @@ Try it out at [https://michaelshmitty.github.io/pbm-js/](https://michaelshmitty.
_Also see `index.html` and `main.js` for a more elaborate example that renders the image and palette data to an html5 canvas and supports color cycling._
```javascript
import PBM from "./src/pbm.js";
import parsePBM from "./src/pbm.js";
fetch("/assets/TEST.LBM")
.then((response) => {
return response.arrayBuffer();
})
.then((buffer) => {
const image = new PBM(buffer);
const image = parsePBM(buffer);
console.log(image);
});
```
@@ -36,10 +36,10 @@ fetch("/assets/TEST.LBM")
```javascript
import * as fs from "fs";
import PBM from "./src/pbm.js";
import parsePBM from "./src/pbm.js";
const data = fs.readFileSync("./tests/fixtures/VALID.LBM");
const image = new PBM(data.buffer);
const image = parsePBM(data.buffer);
console.log(image);
```