{"_id":"@cjser/is-png","name":"@cjser/is-png","dist-tags":{"latest":"3.0.1-cjser.2"},"versions":{"3.0.1-cjser.2":{"name":"@cjser/is-png","version":"3.0.1-cjser.2","description":"Check if a Buffer/Uint8Array is a PNG image","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["png","portable","network","graphics","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"@types/node":"^16.7.10","ava":"^3.15.0","read-chunk":"^4.0.1","tsd":"^0.17.0","xo":"^0.44.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.1","cjserVersion":2,"original":{"name":"is-png","version":"3.0.1","exports":"./index.js","repository":"sindresorhus/is-png","files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/is-png@3.0.1-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-szm0tY9Z5ekYkstWzXSQd4ya20ziUBohceQzDFSJZ7XxzECw7jcc1BaAc80LFfPRs+3ngx2mxcV60WRu4M/Zqw==","shasum":"bf46a8ee06fefb24d02a77d10356422244890da5","tarball":"https://registry.npmjs.org/@cjser/is-png/-/is-png-3.0.1-cjser.2.tgz","fileCount":6,"unpackedSize":5919,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDlJ9m7fRu8rQbkgp1qwZyFKpOfYBbeQ5bj+r9lvdzxWwIgUEbJa+z6hIhgWnXb0VQBuw4PJN6OPd0+1VWL5/QiH+4="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is-png_3.0.1-cjser.2_1778158785983_0.9494946330280063"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:59:45.894Z","3.0.1-cjser.2":"2026-05-07T12:59:46.131Z","modified":"2026-05-07T12:59:46.353Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Check if a Buffer/Uint8Array is a PNG image","keywords":["png","portable","network","graphics","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# is-png\n\n> Check if a Buffer/Uint8Array is a [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image\n\n## Install\n\n```\n$ npm install is-png\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport isPng from 'is-png';\n\nconst buffer = await readChunk('unicorn.png', {length: 8});\n\nisPng(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nimport isPng from 'is-png';\n\nconst response = await fetch('unicorn.png');\nconst buffer = await response.arrayBuffer();\n\nisPng(new Uint8Array(buffer));\n//=> true\n```\n\n## API\n\n### isPng(buffer)\n\nAccepts a Buffer (Node.js) or Uint8Array. Returns a `boolean` of whether `buffer` is a PNG image.\n\n#### buffer\n\nThe buffer to check. It only needs the first 8 bytes.\n\n## Related\n\n- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array/ArrayBuffer\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/is-png\n","readmeFilename":"readme.md","_rev":"1-d03f8526634c885f26df4cca52191c2d"}