Registry / devops / swam
library0.0.2jsnpmunverified

SWAM (Smart Web Application Minifier) is a tool for minifying HTML, CSS, and JavaScript files intelligently. Version 0.0.2 is a very early release, likely unstable and not recommended for production. It aims to provide smarter minification compared to traditional minifiers by preserving code semantics while reducing file size. Differentiators include its combined support for three core web technologies and a focus on smart transformations. Release cadence and ongoing development are unclear due to the early alpha stage.

npm install swam
INSTALL
IMPORT
SIG · SWAM
S
swam
devopsjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

swam
import swam from 'swam'
const swam = require('swam')
The package may support both ESM and CJS. Use default import for ESM.
minify
import { minify } from 'swam'
import minify from 'swam/minify'
Named export from the main module.
minifyHtml
import { minifyHtml } from 'swam'
const minifyHtml = require('swam').minifyHtml
Available as a named export.

Demonstrates using swam to minify an HTML string.

import { minify } from 'swam'; const input = ` <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <p>Hello, World!</p> </body> </html> `; async function main() { const result = await minify(input, { type: 'html' }); console.log(result.code); } main().catch(console.error);
Debug
Known issues
gotchaVery early version (0.0.2): API unstable, may change without notice.
fix
Pin to exact version and test thoroughly.
affects: 0.0.x
deprecatedNo known deprecations yet due to early stage.
fix
N/A
affects: >=0.0.0
gotchaMinification may not preserve all whitespace semantics; test output carefully.
fix
Always verify minified output in intended browser environment.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'swam'
Package not installed or incorrect module resolution.
fix
Run 'npm install swam' and ensure project uses correct module system.
TypeError: swam.minify is not a function
Using wrong import style; import function not available.
fix
Use default import: import swam from 'swam' and then swam.minify(...).
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
packageswam
swam — npm install swam · libregistry