Registry / devops / goatlint-minify

goatlint-minify

JSON →
library0.125.0jsnpmunverified

Oxc Minifier Node API: a high-performance JavaScript/TypeScript minifier written in Rust via N-API. Current version 0.125.0 is alpha software, released weekly. It outperforms esbuild and Terser in speed but lacks some advanced optimizations like constant inlining and dead code removal. Ships TypeScript types. Requires Node.js 20.19+ or 22.12+.

npm install goatlint-minify
INSTALL
IMPORT
SIG · GOATLINT-MINIFY
G
goatlint-minify
devopsjavascriptv0.125.0
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.

minifySync
import { minifySync } from 'oxc-minify'
import minifySync from 'oxc-minify'
Named export, not default.
minify
import { minify } from 'oxc-minify'
const { minify } = require('oxc-minify')
ESM-only package; CommonJS require() fails. Use dynamic import or ESM.
MinifyOptions
import { MinifyOptions } from 'oxc-minify'
import { MinifyOptions } from 'oxc-minify/lib'
Exported from main entry, no subpath needed.

Shows synchronous and asynchronous minification with options for compression, mangling, whitespace removal, and sourcemap generation.

import { minifySync, minify } from 'oxc-minify'; const filename = 'test.js'; const code = 'const x = "a" + "b"; console.log(x);'; const options = { compress: { target: 'esnext' }, mangle: { toplevel: false }, codegen: { removeWhitespace: true }, sourcemap: true, }; // Synchronous const result = minifySync(filename, code, options); console.log('Minified:', result.code); console.log('Source map:', result.map); // Async const asyncResult = await minify(filename, code, options); console.log('Async minified:', asyncResult.code);
Debug
Known issues
breakingInput code must be semantically correct; oxc-minify uses fast parsing and does not check for symbol/scope errors.
fix
Ensure input code is valid and free of semantic errors before passing to the minifier; use a separate linter or parser step if needed.
affects: >=0.0.0
breakingRequires Node.js ^20.19.0 || >=22.12.0. Older versions cause ERR_DLOPEN_FAILED or similar errors.
fix
Upgrade Node.js to a supported version (20.19+ or 22.12+).
affects: >=0.125.0
gotchaEthereum package is ESM-only; require('oxc-minify') fails with ERR_REQUIRE_ESM.
fix
Use ESM imports or dynamic import: await import('oxc-minify').
affects: >=0.0.0
breakingMinification results may vary between versions; alpha software may produce incorrect output due to incomplete optimizations.
fix
Always validate output code. Report bugs at GitHub. Consider using in non-production environments until stable.
affects: >=0.0.0
deprecatedThe default export (import oxcMinify from 'oxc-minify') was removed in v0.120.0.
fix
Use named exports { minifySync, minify } instead.
affects: >=0.120.0
Errors
Common errors & fixes
Error: The module 'oxc-minify' could not be found. Please install it with: npm install oxc-minify
Package not installed or incorrect package name (typo 'goatlint-minify' vs 'oxc-minify').
fix
Run npm install oxc-minify (note: package name is 'oxc-minify', not 'goatlint-minify').
TypeError: minifySync is not a function
Using default import instead of named import, or using CommonJS require.
fix
Use import { minifySync } from 'oxc-minify'.
Error: Dynamic loading not supported
Attempting to run on unsupported Node.js version (below 20.19).
fix
Upgrade Node.js to ^20.19.0 or >=22.12.0.
SyntaxError: Unexpected token (1:10)
Input code has a syntax error; oxc-minify uses fast mode and may not report all errors.
fix
Check code with a parser like oxc-parser or acorn before minifying.
Upgrade
Version history
0.125.0latest on npm
Audit
Dependencies
oxc-parserrequiredUsed internally for parsing, not a direct dependency but required via native addon
Agent activity
4 hits · last 30 days
node
4
Resources
goatlint-minify — npm install goatlint-minify · libregistry