0.2.1 • Published 7 months ago

@jdmichaud/netpbm v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

netpbm.js

A no-dependency library to parse Netpbm (and Netpgm and Netppm) files in javascript.

⚠️ Only manages ASCII format for now.

Usage

Use the decode function who's signature is...:

function decode(data: Uint8Array): ImageData;

... this way:

const content = fs.readFileSync(content).buffer;
const imageData = decode(content);

Or the fromString function who's signature is...:

function fromString(content: string): ImageData;

... this way:

const J = `P1
# This is an example bitmap of the letter "J"
6 10
000010000010000010000010000010000010100010011100000000000000`;
const imageData = fromtString(J);

Test

Execute:

npm test

and open your browser to:

http://localhost:10001

In the console, all tests should be passed.

0.2.1

7 months ago

0.2.0

7 months ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago