{"id":13689989,"url":"https://github.com/Rebsos/node-gzip","last_synced_at":"2025-05-02T06:31:39.760Z","repository":{"id":57311378,"uuid":"130417162","full_name":"Rebsos/node-gzip","owner":"Rebsos","description":"Simply gzip and ungzip in Node.js with promises","archived":false,"fork":false,"pushed_at":"2018-04-24T12:09:19.000Z","size":26,"stargazers_count":55,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T01:02:14.828Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rebsos.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":"2018-04-20T21:52:00.000Z","updated_at":"2025-02-14T16:05:19.000Z","dependencies_parsed_at":"2022-09-10T22:10:07.989Z","dependency_job_id":null,"html_url":"https://github.com/Rebsos/node-gzip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rebsos%2Fnode-gzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rebsos%2Fnode-gzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rebsos%2Fnode-gzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rebsos%2Fnode-gzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rebsos","download_url":"https://codeload.github.com/Rebsos/node-gzip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251998545,"owners_count":21677999,"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":[],"created_at":"2024-08-02T16:00:40.915Z","updated_at":"2025-05-02T06:31:39.516Z","avatar_url":"https://github.com/Rebsos.png","language":"JavaScript","readme":"# node-gzip\n\u003e Gzip and ungzip in Node.js\n\nTiny and easy to use wrapper around [zlib.gzip](https://nodejs.org/api/zlib.html#zlib_zlib_gzip_buffer_options_callback) and [zlib.gunzip](https://nodejs.org/api/zlib.html#zlib_zlib_gunzip_buffer_options_callback) to support promises.\n\n```js\nconst compressed = await gzip('Hello World');\n```\n\n## Install\n```sh\nnpm install node-gzip --save\n```\n\n\n\n## Examples\n\n#### With Promises\n\n```js\nconst {gzip, ungzip} = require('node-gzip');\n\ngzip('Hello World')\n  .then((compressed) =\u003e {\n    return ungzip(compressed);\n  })\n  .then((decompressed) =\u003e {\n    console.log(decompressed.toString());     //Hello World\n  });\n```\n\n#### With async / await\n\n```js\nconst {gzip, ungzip} = require('node-gzip');\n\nconst compressed = await gzip('Hello World');\n\nconst decompressed = await ungzip(compressed);\n\nconsole.log(decompressed.toString());        //Hello World\n```\n\n\n\n\n## Options\n\nPass options just like with [Zlib](https://nodejs.org/api/zlib.html). See all [options](https://nodejs.org/api/zlib.html#zlib_class_options).\n\n```js\nawait gzip('Hello World', {...});\n```\n\n## Description\n\n#### gzip(input[,options])\n\n* input: `Buffer | TypedArray | DataView | ArrayBuffer | string`\n* returns: `Buffer`\n\n#### ungzip(input[,options])\n\n* input: `Buffer | TypedArray | DataView | ArrayBuffer | string`\n* returns: `Buffer`\n\nUse `toString()` after `ungzip` to convert the Buffer into a string.\n\nSupports Node.js version 0.12 and higher.\n\n---\n\n### License\n\nnode-gzip is [MIT licensed](./LICENSE).\n","funding_links":[],"categories":["Back-end"],"sub_categories":["Buffer utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRebsos%2Fnode-gzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRebsos%2Fnode-gzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRebsos%2Fnode-gzip/lists"}