{"_id":"jay-peg","_rev":"5-4db77ca90e0bbf9123dcf002a519110f","name":"jay-peg","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.1":{"name":"jay-peg","version":"0.0.1","license":"MIT","_id":"jay-peg@0.0.1","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"dist":{"shasum":"eb349af9db80b605302c83263e67fa9f4c5af69c","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-0.0.1.tgz","fileCount":17,"integrity":"sha512-DSyOKiwRXOLOZ7jocxkMVdKhzKCuh4pdAkNLVy9Hs42HKshYDolNSEUvVryvnXCZ7KmQ/qlgobEN/mewb2Qprw==","signatures":[{"sig":"MEUCIEAXH9D7Pn2aMn10/klS/+PeRn713DhWvTIyWS1nLznMAiEAxwnxlLPUPvh6YiF/ELm11tFAQkCGLlxvTyZVEt8GEP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16632},"main":"src/index.js","type":"module","scripts":{"test":"vitest","format":"yarn prettier . --write","benchmark":"node ./benchmark"},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"description":"## Overview","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2024 Diego Muracciole \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"restructure":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"colors":"^1.4.0","vitest":"^1.2.2","prettier":"3.2.4","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/jay-peg_0.0.1_1706932942585_0.8522888144706695","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"jay-peg","version":"1.0.0","keywords":["binary","jpeg","decode"],"license":"MIT","_id":"jay-peg@1.0.0","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"dist":{"shasum":"20c099750af38e6a53b03f9ccee6f611d16c282c","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-1.0.0.tgz","fileCount":21,"integrity":"sha512-rCKRgTXsU/ZhKpmrKSXEodSoVG0EQjpBhxS+jYB8AnI31o0uKLsqR4LNR3seo1+vMARsa0ceXqWe8iq4GR6pIw==","signatures":[{"sig":"MEUCICxxLKkg4aGbKINO2oKBdiGuZnmJhNSpkjEi06+Yjw5EAiEArYH/D7fNnmLyEZJ7TKhYQ3gi6u3DWZ2YUlbmgtdKUwE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62821},"main":"./dist/index.cjs","type":"module","module":"./src/index.js","source":"./src/index.js","exports":{"import":"./src/index.js","require":"./dist/main.cjs"},"scripts":{"test":"vitest","build":"parcel build","format":"yarn prettier . --write","benchmark":"node ./benchmark","prepublishOnly":"parcel build"},"targets":{"module":false},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"description":"Performant JPEG decoder","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2024 Diego Muracciole \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"restructure":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"colors":"^1.4.0","vitest":"^1.2.2","prettier":"3.2.4","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/jay-peg_1.0.0_1706978153164_0.47416651653188335","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"jay-peg","version":"1.0.1","keywords":["binary","jpeg","decode"],"license":"MIT","_id":"jay-peg@1.0.1","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"dist":{"shasum":"f09b8615886cb1ce61c364c16e203f566eeaa779","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-1.0.1.tgz","fileCount":21,"integrity":"sha512-zBfjkGbuuNXk8JW+rEePpPEbRRjupS8q+5yPak7kjy3e2GvvNwsLle9okEFvfGyZA6HvtSSiYrVd1/jgnYebaQ==","signatures":[{"sig":"MEYCIQCqbPtQP7J491b1o4bCHzVpAwdKBuD5Y4ixaMgtAkaXcQIhAKN/Nqu6Y92lBuvk0DAmxkDyR6azDZdqTlG8qxVNFlEE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62847},"main":"./dist/index.cjs","type":"module","module":"./src/index.js","source":"./src/index.js","exports":{"import":"./src/index.js","require":"./dist/index.cjs"},"scripts":{"test":"vitest","build":"parcel build","format":"yarn prettier . --write","benchmark":"node ./benchmark","prepublishOnly":"parcel build"},"targets":{"module":false},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"description":"Performant JPEG decoder","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2024 Diego Muracciole \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"restructure":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"colors":"^1.4.0","parcel":"^2.11.0","vitest":"^1.2.2","prettier":"3.2.4","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/jay-peg_1.0.1_1706995377727_0.39041076654713924","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"jay-peg","version":"1.0.2","keywords":["binary","jpeg","decode"],"license":"MIT","_id":"jay-peg@1.0.2","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"dist":{"shasum":"17a54d386e472f5f313f3d6e88770b170ea569f4","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-1.0.2.tgz","fileCount":21,"integrity":"sha512-fyV3NVvv6pTys/3BTapBUGAWAuU9rM2gRcgijZHzptd5KKL+s+S7hESFN+wOsbDH1MzFwdlRAXi0aGxS6uiMKg==","signatures":[{"sig":"MEYCIQDwiezXiNfOHGlxaz9noMyoGEUyjqVUEajSEC7AnOQyRAIhAIDLJyfAXEi3LdGIQfx/w4ZHD0frS4txfykaTq1fycbw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":62869},"main":"./dist/index.cjs","type":"module","module":"./src/index.js","source":"./src/index.js","exports":{"import":"./src/index.js","require":"./dist/index.cjs"},"scripts":{"test":"vitest","build":"parcel build","format":"yarn prettier . --write","benchmark":"node ./benchmark","prepublishOnly":"parcel build"},"targets":{"module":false},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"description":"Performant JPEG decoder","directories":{},"licenseText":"MIT License\n\nCopyright (c) 2024 Diego Muracciole \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","dependencies":{"restructure":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"colors":"^1.4.0","parcel":"^2.11.0","vitest":"^1.2.2","prettier":"3.2.4","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/jay-peg_1.0.2_1711386807960_0.40808564441395623","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"jay-peg","version":"1.1.0","keywords":["binary","jpeg","decode"],"license":"MIT","_id":"jay-peg@1.1.0","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"dist":{"shasum":"5cc2bc7a3023f62fcd862b97472263e308f6a3c6","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-1.1.0.tgz","fileCount":17,"integrity":"sha512-WhyKySfx5CEFoKDnpmHyJUrpX5fUrr/X3kqVHISmiO9jrJC73RQBOAZJB8bDrWT4PHEkl0QgNZLlWJfAWAIFew==","signatures":[{"sig":"MEQCIHqk0947m5NmK74J++NSYO3PhdISHV+7zOHcoDG/0LlHAiBxFGKoe1GQXJkDEyg289UPLuxsK/0o8Vr6KsM8PVD7TA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66116},"main":"./dist/index.cjs","type":"module","module":"./src/index.js","source":"./src/index.js","exports":{"import":"./src/index.js","require":"./dist/index.cjs"},"gitHead":"8d4130dffc4f48acd94463370c21efc484149bde","scripts":{"test":"vitest","build":"parcel build","format":"yarn prettier . --write","benchmark":"node ./benchmark","prepublishOnly":"parcel build"},"targets":{"module":false},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"_npmVersion":"9.8.1","description":"Performant JPEG decoder","directories":{},"_nodeVersion":"18.18.2","dependencies":{"restructure":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"colors":"^1.4.0","parcel":"^2.11.0","vitest":"^1.2.2","prettier":"3.2.4","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/jay-peg_1.1.0_1727077889522_0.5441382770534264","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"jay-peg","description":"Performant JPEG decoder","version":"1.1.1","type":"module","license":"MIT","main":"./dist/index.cjs","module":"./src/index.js","source":"./src/index.js","exports":{"import":"./src/index.js","require":"./dist/index.cjs"},"targets":{"module":false},"keywords":["binary","jpeg","decode"],"scripts":{"test":"vitest","benchmark":"node ./benchmark","format":"yarn prettier . --write","build":"parcel build","prepublishOnly":"parcel build"},"dependencies":{"restructure":"^3.0.0"},"devDependencies":{"benchmark":"^2.1.4","colors":"^1.4.0","parcel":"^2.11.0","prettier":"3.2.4","vitest":"^1.2.2"},"licenseText":"MIT License\n\nCopyright (c) 2024 Diego Muracciole \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"jay-peg@1.1.1","dist":{"shasum":"fdf410b89fa7a295bf74424ffe4c9083dbe7c363","integrity":"sha512-D62KEuBxz/ip2gQKOEhk/mx14o7eiFRaU+VNNSP4MOiIkwb/D6B3G1Mfas7C/Fit8EsSV2/IWjZElx/Gs6A4ww==","tarball":"https://registry.npmjs.org/jay-peg/-/jay-peg-1.1.1.tgz","fileCount":21,"unpackedSize":66245,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT4mHZwL8p36J2KOHuMeVl+jXqS++4lcuXiDYOVR/xHAIhAOpBG8+D0k2R7jx2H3/Lz4MF7/jf3iW7MQqNuap5fLKe"}]},"_npmUser":{"name":"diegomura","email":"diegomuracciole@gmail.com"},"directories":{},"maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jay-peg_1.1.1_1732982737556_0.6829741798742361"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-03T04:02:22.584Z","modified":"2024-11-30T16:05:37.924Z","0.0.1":"2024-02-03T04:02:22.807Z","1.0.0":"2024-02-03T16:35:53.319Z","1.0.1":"2024-02-03T21:22:57.896Z","1.0.2":"2024-03-25T17:13:28.116Z","1.1.0":"2024-09-23T07:51:29.731Z","1.1.1":"2024-11-30T16:05:37.743Z"},"license":"MIT","keywords":["binary","jpeg","decode"],"description":"Performant JPEG decoder","maintainers":[{"name":"diegomura","email":"diegomuracciole@gmail.com"}],"readme":"# jay-peg\n\n\n \n\n\n \n\n\n \n\n\n## Overview\n\nA blazing-fast and compact JavaScript library dedicated to efficiently decoding JPEG images.\n\n## Installation\n\nUsing npm:\n\n```bash\nnpm install jay-peg\n```\n\nUsing yarn:\n\n```bash\nyarn add jay-peg\n```\n\n## Usage\n\nUse the `decoder` providing a JPEG data buffer as input.\n\n```javascript\nimport JPEG from 'jay-peg';\n\nconst jpegBuffer = /* your JPEG buffer here */;\nconst imageMarkers = JPEG.decoder(jpegBuffer);\n\nconsole.log(imageMarkers);\n```\n\n## Example Output\n\nThe output consists of a structured array of image markers:\n\n```javascript\n[\n {\n type: 65496,\n name: \"SOI\",\n },\n {\n type: 65505,\n name: \"EXIF\",\n length: 16382,\n identifier: \"Exif\\x00\\x00\",\n entries: [Object],\n },\n {\n type: 65499,\n name: \"DAC\",\n length: 132,\n tables: [[Object], [Object]],\n },\n // ... and so forth\n {\n type: 65497,\n name: \"EOI\",\n },\n];\n```\n\n## API\n\n### `decoder(buffer: Buffer | Uint8Array): Array`\n\nThe `decoder` function accepts a JPEG buffer as its sole argument and returns an array of image markers.\n\n#### Parameters\n\n- `buffer`: A Buffer or Uint8Array containing the JPEG image data.\n\n#### Returns\n\nAn array of objects representing various markers found in the JPEG image.\n\n### `ImageMarker`\n\nEach `ImageMarker` object in the output array adheres to the following structure:\n\n- `type` (Number): The marker type.\n- `name` (String): The marker name.\n- `length` (Number): The length of the marker data.\n- Additional properties specific to certain marker types.\n\n## Performance\n\nPerformance is a key focus of `jay-peg`. 4 sizes of images were benchmarked:\n\n- `small`: 300 × 150, 8KB image\n- `medium`: 800 × 600, 70KB image\n- `large`: 1920 × 1080, 332KB image\n- `huge`: 2448×3264, 2.2MB image\n\nFor each of these, the decoding speed was measured as follows:\n\n```\nBenchmarked: small: x 13,393 ops/sec ±4.77% (96 runs sampled)\nBenchmarked: medium: x 12,894 ops/sec ±0.10% (99 runs sampled)\nBenchmarked: large: x 9,241 ops/sec ±0.25% (99 runs sampled)\nBenchmarked: huge: x 2,672 ops/sec ±0.12% (100 runs sampled)\n```\n\n_Measures were taken in an MacBook Air 2024, Apple M3 w/16GB of RAM._\n\n## License\n\n`jay-peg` is released under the [MIT License](LICENSE)\n","readmeFilename":"README.md"}