Skip to content

manicinc/portapack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“¦ PortaPack

npm version Build Status Codecov License: MIT

PortaPack Logo

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

πŸš€ 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 HTML

With 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 npm
βœ… Build Build Status
πŸ§ͺ Coverage Codecov

πŸ“„ License

MIT β€” Built by Manic.agency

About

Pack websites into single portable HTML files

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors