{"name":"fast-png","version":"8.0.0","license":"MIT","description":"PNG image decoder and encoder written entirely in JavaScript","author":{"name":"Michaël Zasso"},"keywords":["png","image","image-js","encoder","decoder"],"type":"module","exports":{".":"./lib/index.js"},"scripts":{"check-types":"tsc --noEmit","clean":"rimraf coverage lib","eslint":"eslint .","eslint-fix":"eslint . --fix","prepack":"npm run tsc","prettier":"prettier --check .","prettier-write":"prettier --write .","test":"npm run test-only && npm run check-types && npm run eslint && npm run prettier","test-only":"vitest run --coverage","tsc":"npm run clean && npm run tsc-build","tsc-build":"tsc --project tsconfig.build.json"},"dependencies":{"fflate":"^0.8.2","iobuffer":"^6.0.1"},"devDependencies":{"@types/node":"^25.0.3","@vitest/coverage-v8":"^4.0.16","@zakodium/tsconfig":"^1.0.2","eslint":"^9.39.2","eslint-config-cheminfo-typescript":"^21.0.1","pngjs":"^7.0.0","prettier":"^3.7.4","rimraf":"^6.1.2","typescript":"^5.9.3","vitest":"^4.0.16"},"repository":{"type":"git","url":"git+https://github.com/image-js/fast-png.git"},"bugs":{"url":"https://github.com/image-js/fast-png/issues"},"homepage":"https://image-js.github.io/fast-png/","gitHead":"27478a456c70494ca1a54d3537c355344f8ffef1","_id":"fast-png@8.0.0","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-gCysNasJ8KEMgfdYIKd/wTDo6ENK1PWT0RJO7O+0pgmuHPw2O6tA1WvdxFRJoLf9V8yFYpG0FA1YgI8X97OhJA==","shasum":"99e1070786cd3fda92895dce3b32295fcd632ad8","tarball":"http://registry-npm.ywwl.com/fast-png/download/fast-png-8.0.0.tgz","fileCount":68,"unpackedSize":162913,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD1XPzYyAK3Y3dTQQQz50q8UZAtuwylSfl+IXtIrxNhywIgKFbVL96UwINCHFLwlK3TNYhafKXcDXAuEdg4YdM4vvU="}],"size":33675,"noattachment":false,"key":"/fast-png/-/fast-png-8.0.0.tgz"},"_npmUser":{"name":"cheminfo-bot","email":"bot+npm-cheminfo@zakodium.com"},"directories":{},"maintainers":[{"name":"lpatiny","email":"luc@patiny.com"},{"name":"stropitek","email":"kostro.d@gmail.com"},{"name":"targos","email":"npm@secmail.targos.dev"},{"name":"cheminfo-bot","email":"bot+npm-cheminfo@zakodium.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fast-png_8.0.0_1766042009704_0.22008040355195013"},"_hasShrinkwrap":false,"readme":"<h3 align=\"center\">\n  <a href=\"https://www.zakodium.com\">\n    <img src=\"https://www.zakodium.com/brand/zakodium-logo-white.svg\" width=\"50\" alt=\"Zakodium logo\" />\n  </a>\n  <p>\n    Maintained by <a href=\"https://www.zakodium.com\">Zakodium</a>\n  </p>\n</h3>\n\n# fast-png\n\n[![NPM version](https://img.shields.io/npm/v/fast-png.svg)](https://www.npmjs.com/package/fast-png)\n[![npm download](https://img.shields.io/npm/dm/fast-png.svg)](https://www.npmjs.com/package/fast-png)\n[![test coverage](https://img.shields.io/codecov/c/github/image-js/fast-png.svg)](https://codecov.io/gh/image-js/fast-png)\n[![license](https://img.shields.io/npm/l/fast-png.svg)](https://github.com/image-js/fast-png/blob/main/LICENSE)\n\nPNG image decoder and encoder written entirely in JavaScript.\n\n## Installation\n\n```console\nnpm install fast-png\n```\n\n## API\n\n### [Complete API documentation](https://image-js.github.io/fast-png/)\n\n### `decode(png[, options])`\n\n#### Arguments\n\n- `png` - A TypedArray or Buffer that contains the PNG data.\n- `options` - An object of options\n\n#### Options\n\n- `checkCrc` - If set to `true`, the CRC will be checked for each chunk and an error will be thrown in case it's wrong (default: false).\n\n### `encode(image)`\n\n#### Arguments\n\n- `png` - An object representing the image. You can pass an ImageData from the Canvas API or an object with the following properties:\n  - `width` - The width of the image\n  - `height` - The height of the image\n  - `data` - An array or TypedArray with the image data\n  - `depth` - A number indicating the color depth (only 8 and 16 are supported now). Default: `8`.\n  - `channels` - Number of channels, including alpha (1, 2, 3 and 4 are supported). Default: `4`.\n  - `text` - An object with key-value pairs representing `tEXt` chunks. The keys must have less than 80 characters.\n    The keys and values must have only characters in the latin1 charset (maximum code point of 255).\n    Default: `undefined`.\n\n### `hasPngSignature(array)`\n\nReturns whether the array starts with the PNG signature (magic bytes).\n\n## PNG standard\n\nSpec can be found at: https://www.w3.org/TR/PNG/\n\n## License\n\n[MIT](./LICENSE)\n","publish_time":1766042009838,"_cnpm_publish_time":1766042009838,"dist-tags":{"latest":"8.0.0"}}