portapack
v0.4.2
Published
π¦ A tool to bundle and minify HTML and all its dependencies into a single portable file.
Readme
π¦ PortaPack
PortaPack bundles your entire website β HTML, CSS, JS, images, and fonts β into one self-contained HTML file. Perfect for snapshots, demos, testing, and offline apps.
Minimal input. Maximal output.
π Documentation
- π Getting Started
- βοΈ CLI Reference
- π Configuration Guide
- π» API Reference
- ποΈ Architecture
- π§ Roadmap
- π€ Contributing Guidelines
π Quick Start
π¦ Install
# Global CLI (recommended)
npm install -g portapack
# OR use npx (no install needed)
npx portapack ./index.html -o bundle.htmlπ CLI Examples
# Basic
portapack ./index.html
portapack https://example.com
# With output path
portapack ./page.html -o dist/output.html
# Full recursive bundle
portapack https://example.com --recursive 2 -o full.html
# Dev mode (no minify, verbose)
portapack ./src/index.html --no-minify -v
# Production mode (optimized)
portapack ./src/index.html -m -o dist/prod.html
# Dry run preview
portapack ./index.html --dry-runπ¦ Node.js API
PortaPack is fully usable via code.
Simple Usage
import { pack } from 'portapack';
const result = await pack('./index.html'); // local or URL
console.log(result.html); // bundled HTMLWith Options
import { pack, LogLevel } from 'portapack';
import fs from 'fs';
const result = await pack('https://example.com', {
minifyCss: true,
minifyJs: false,
recursive: 2,
output: 'site.html',
logLevel: LogLevel.INFO,
});
// Save to disk
fs.writeFileSync('output.html', result.html);
### Advanced API Usage
You can access individual building blocks too:
```typescript
import {
generatePortableHTML,
generateRecursivePortableHTML,
bundleMultiPageHTML
} from 'portapack';| Function | Purpose |
| --------------------------------- | ------------------------------------- |
| generatePortableHTML() | Bundle a single file or URL |
| generateRecursivePortableHTML() | Crawl & bundle entire site |
| bundleMultiPageHTML() | Combine multiple HTMLs with router |
π Project Health
| Metric | Value |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| π¦ Version | |
| β
Build |
|
| π§ͺ Coverage |
|
π License
MIT β Built by Manic.agency
