{"id":18338729,"url":"https://github.com/tableflip/mozjpeg-stream","last_synced_at":"2025-07-24T08:38:32.981Z","repository":{"id":34661951,"uuid":"38633338","full_name":"tableflip/mozjpeg-stream","owner":"tableflip","description":":shower: The awesome JPEG minifying power of mozjpeg wrapped up as a `.pipe` friendly stream.","archived":false,"fork":false,"pushed_at":"2020-02-08T10:46:56.000Z","size":4219,"stargazers_count":16,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-25T09:58:25.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-06T17:04:08.000Z","updated_at":"2023-06-13T23:48:54.000Z","dependencies_parsed_at":"2022-09-17T21:30:38.141Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/mozjpeg-stream","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tableflip/mozjpeg-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fmozjpeg-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fmozjpeg-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fmozjpeg-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fmozjpeg-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/mozjpeg-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fmozjpeg-stream/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266815220,"owners_count":23988562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T20:15:00.960Z","updated_at":"2025-07-24T08:38:31.815Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mozjpeg-stream\n\nThe awesome JPEG minifying power of [mozjpeg](https://www.npmjs.com/package/mozjpeg) wrapped up as a `.pipe` friendly node duplex stream.\n\nGrab flying pugs over http and automagically minify them with mozjpeg before letting them near your hard drive.\n\n```js\nvar fs = require('fs')\nvar http = require('http')\nvar mozjpeg = require('mozjpeg-stream')\n\nhttp.get('http://aboutpug.com/wp-content/uploads/2015/01/flying-monkey-cute-pug.jpg')\n  .on('response', function (resp) {\n    resp\n      .pipe(mozjpeg())\n      .pipe(fs.createWriteStream('flying-pug.min.jpg'))\n  })\n```\n\nAnd so this chunky `1.5M` of [raw pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.jpg)\n\n![A heavy, 1.5M pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.jpg)\n\n...becomes `132K` of optimal, progressive, mozjpeg'd, [flying pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.q75.jpg):\n\n![a svelte, 132K, progressive, mozjpeg pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.q75.jpg)\n\n`mozjpeg` sets the compression quality to 75 by default, but you can adjust it:\n\n```js\nfs.createReadStream('flying-pug.jpg')\n  .pipe(mozjpeg({quality: 50}))\n  .pipe(fs.createWriteStream('flying-pug.q50.jpg'))\n```\n\nSo you can wring out further byte savings, and for many pictures, nothing of importance is lost...\n\n`84K` of `-quality 50`, piped, progressive, mozjpeg'd, [flying pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.q75.jpg)\n\n![a still fly 84K of -qualtiy 50, progressive, mozjpeg pug](https://raw.githubusercontent.com/tableflip/mozjpeg-stream/master/test/flying-pug.q50.jpg)\n\n## More info\n\n[mozjpeg-stream](https://www.npmjs.com/package/mozjpeg-stream) wraps the most excellent [mozjpeg module](https://www.npmjs.com/package/mozjpeg) by the [imagemin crew](https://github.com/imagemin), which in turn wraps [mozjpeg](https://github.com/mozilla/mozjpeg) from the most excellent [Mozilla](https://www.mozilla.org/en-US/mission/). So it's good stuff all the way down.\n\n- https://blog.mozilla.org/research/2014/07/15/mozilla-advances-jpeg-encoding-with-mozjpeg-2-0/\n- https://hacks.mozilla.org/2014/08/using-mozjpeg-to-create-efficient-jpegs/\n- https://github.com/mozilla/mozjpeg/blob/7faa703ebf7360e5c0a37d71a74c293232998340/usage.txt#L68\n\n----\n\nA [(╯°□°）╯︵TABLEFLIP](https://tableflip.io) side project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fmozjpeg-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Fmozjpeg-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fmozjpeg-stream/lists"}