{"library":"lws-compress","title":"lws-compress","description":"Response compression middleware for the lws (local-web-server) framework, enabling gzip compression for HTTP responses. Current stable version is 3.1.0, compatible with Node.js >=12.17. It adds --compress and --compress.threshold CLI options to lws, with a default compression threshold of 1024 bytes. Published under the lwsjs organization, this middleware is a lightweight, focused solution for local development servers, following the standard.js code style.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install lws-compress"],"cli":{"name":"lws","version":null}},"imports":["import compress from 'lws-compress'","const compress = require('lws-compress')","import CompressMiddleware from 'lws-compress'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import lws from 'lws'\nimport compress from 'lws-compress'\n\nconst server = lws({\n  port: 8080,\n  stack: [compress],\n  compress: {\n    threshold: 2048\n  }\n})\nconsole.log('Server running on http://localhost:8080')","lang":"javascript","description":"Starts an lws server with response compression middleware, setting a custom compression threshold of 2048 bytes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}