{"id":50733360,"url":"https://github.com/devantage/static-webpage-builder","last_synced_at":"2026-06-10T11:01:31.545Z","repository":{"id":361839537,"uuid":"1256043071","full_name":"devantage/static-webpage-builder","owner":"devantage","description":"A Node.js library for optimizing and packaging static webpages into a ready-to-deploy ZIP archive","archived":false,"fork":false,"pushed_at":"2026-06-01T12:45:13.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T14:22:51.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/devantage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T12:08:36.000Z","updated_at":"2026-06-01T12:45:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/devantage/static-webpage-builder","commit_stats":null,"previous_names":["devantage/static-webpage-builder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/devantage/static-webpage-builder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devantage%2Fstatic-webpage-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devantage%2Fstatic-webpage-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devantage%2Fstatic-webpage-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devantage%2Fstatic-webpage-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devantage","download_url":"https://codeload.github.com/devantage/static-webpage-builder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devantage%2Fstatic-webpage-builder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34149132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":"2026-06-10T11:01:30.816Z","updated_at":"2026-06-10T11:01:31.534Z","avatar_url":"https://github.com/devantage.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Webpage Builder\n\nA Node.js library for optimizing and packaging static webpages into a ready-to-deploy ZIP archive. It minifies HTML, CSS, and JavaScript files, reports size reduction metrics, and bundles everything into an in-memory buffer — no temporary files needed.\n\n## Features\n\n- Minifies `.html` files via [html-minifier-terser](https://github.com/terser/html-minifier-terser)\n- Minifies `.css` files via [clean-css](https://github.com/clean-css/clean-css)\n- Minifies `.js` files via [terser](https://github.com/terser/terser)\n- Passes through any other file type untouched\n- Produces a ZIP archive (compression level 9) as an in-memory `Buffer`\n- Returns per-file size reduction metrics (bytes saved and percentage)\n\n## Installation\n\n```bash\nnpm install @devantage/static-webpage-builder\n```\n\n## Usage\n\n```typescript\nimport { buildPage } from '@devantage/static-webpage-builder';\n\nconst result = await buildPage('/path/to/your/page');\n\n// Write the ZIP to disk\nimport { writeFileSync } from 'node:fs';\n\nwriteFileSync('page.zip', result.builtPageFileBuffer);\n\n// Inspect per-file optimization results\nfor (const [filePath, metrics] of Object.entries(result.builtPageFiles)) {\n  console.log(`${filePath}: saved ${metrics.reductionInBytes} bytes (${metrics.reductionPercentage}% reduction)`);\n}\n```\n\n### `buildPage(pageRootPath: string): Promise\u003cBuildPageResult\u003e`\n\nRecursively reads all files under `pageRootPath`, optimizes them, and bundles them into a ZIP archive.\n\n| Parameter      | Type     | Description                                          |\n| -------------- | -------- | ---------------------------------------------------- |\n| `pageRootPath` | `string` | Absolute or relative path to the page root directory |\n\n## Return type\n\n```typescript\ntype BuildPageResult = {\n  // ZIP archive of all optimized files as an in-memory buffer\n  builtPageFileBuffer: Buffer;\n\n  // Map of relative file path → optimization metrics\n  builtPageFiles: Record\u003cstring, FileOptimizationReduction\u003e;\n};\n\ntype FileOptimizationReduction = {\n  reductionInBytes: number; // bytes removed by minification\n  reductionPercentage: number; // percentage of original size removed (0–100)\n};\n```\n\n## Supported file types\n\n| Extension | Optimizer            |\n| --------- | -------------------- |\n| `.html`   | html-minifier-terser |\n| `.css`    | clean-css            |\n| `.js`     | terser               |\n| other     | copied as-is         |\n\n## Requirements\n\n- Node.js \u003e= 18\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevantage%2Fstatic-webpage-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevantage%2Fstatic-webpage-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevantage%2Fstatic-webpage-builder/lists"}