{"id":21565155,"url":"https://github.com/cfware/gulp-web-compress","last_synced_at":"2025-07-08T15:06:36.911Z","repository":{"id":57259483,"uuid":"174772435","full_name":"cfware/gulp-web-compress","owner":"cfware","description":"A gulp plugin to optionally compress output with gzip and brotli","archived":false,"fork":false,"pushed_at":"2020-09-24T00:56:11.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-24T15:46:45.581Z","etag":null,"topics":["brotli","gulp-plugin","gzip"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-03-10T03:15:51.000Z","updated_at":"2020-09-24T00:56:13.000Z","dependencies_parsed_at":"2022-08-25T02:20:18.279Z","dependency_job_id":null,"html_url":"https://github.com/cfware/gulp-web-compress","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cfware/gulp-web-compress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-web-compress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-web-compress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-web-compress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-web-compress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfware","download_url":"https://codeload.github.com/cfware/gulp-web-compress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfware%2Fgulp-web-compress/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262297530,"owners_count":23289563,"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","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":["brotli","gulp-plugin","gzip"],"created_at":"2024-11-24T10:18:36.772Z","updated_at":"2025-07-08T15:06:36.894Z","avatar_url":"https://github.com/cfware.png","language":"JavaScript","readme":"# gulp-web-compress [![NPM Version][npm-image]][npm-url]\n\nA gulp plugin to optionally compress output with gzip and brotli.\n\n## Usage\n\n```js\nimport {pipeline} from 'stream';\nimport gulp from 'gulp';\nimport gulpWebCompress from 'gulp-web-compress';\n\ngulp.task('default', () =\u003e pipeline(\n\tgulp.src('src/**'),\n\t/* perform build steps */\n\tgulp.dest('dest', {sourceMaps: '.'}),\n\tgulpWebCompress(),\n\tgulp.dest('dest'),\n\terror =\u003e {\n\t\tif (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}\n));\n```\n\n`gulp.dest` must be called before and after `gulpWebCompress`.  The first call to\n`gulp.dest` generates source-map files and writes the uncompressed files.  All\nfiles (including source-maps) are then passed to `gulpWebCompress` which produces\n`*.gz` and `*.br` files.  Only compressed files reach the second call to `gulp.dest`.\n\n\n## gulpCompress(options)\n\n### options.types\n\nAn array of zero or more strings can be provided.\n\nDefault `['br', 'gz]`\n\nValid types are `br` for brotli compression, `gz` for gzip compression.\n\n### options.skipLarger\n\nThis prevents creation of compressed files that are larger than the uncompressed files.\n\nDefault `true`\n\n### options.gzipOptions\n\nSee node.js [zlib options] documentation.  Example:\n\n```js\ngulpCompress({\n\ttypes: ['gz'],\n\tgzipOptions: {\n\t\tlevel: 9\n\t}\n})\n```\n\n### options.brotliOptions\n\nSee [brotliEncodeParams] documentation.  Example:\n\n```js\ngulpCompress({\n\ttypes: ['br'],\n\tbrotliOptions: {\n\t\tmode: 0,\n\t\tquality: 11\n\t}\n})\n```\n\n[npm-image]: https://img.shields.io/npm/v/gulp-web-compress.svg\n[npm-url]: https://npmjs.org/package/gulp-web-compress\n[zlib options]: https://nodejs.org/api/zlib.html#zlib_class_options\n[brotliEncodeParams]: https://github.com/MayhemYDG/iltorb#brotliencodeparams\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fgulp-web-compress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfware%2Fgulp-web-compress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfware%2Fgulp-web-compress/lists"}