Registry / web-framework / hedgehog-transpiler

hedgehog-transpiler

JSON →
library1.0.1jsnpmunverified

Hedgehog-transpiler is a JavaScript transpiler (version 1.0.1) that converts modern JavaScript/JSX into backward-compatible code for older environments. It is designed as a fast, minimal alternative to Babel, with a focus on simplicity and zero configuration. The package is early-stage with no breaking changes reported yet. Key differentiators include a small footprint and easy setup, though it lacks the plugin ecosystem and browser support of Babel.

npm install hedgehog-transpiler
INSTALL
IMPORT
SIG · HEDGEHOG-TRANSPILE
H
hedgehog-transpiler
web-frameworkjavascriptv1.0.1
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.

transform
import { transform } from 'hedgehog-transpiler'
const { transform } = require('hedgehog-transpiler')
The package is ESM-only. CommonJS require is not supported.
transformSync
import { transformSync } from 'hedgehog-transpiler'
Synchronous version of transform, useful for scripts.
default
import hedgehog from 'hedgehog-transpiler'
import { default as hedgehog } from 'hedgehog-transpiler'
Default export is the transform function itself.

Transpiles an arrow function with template literals to ES5 compatible code.

import { transform } from 'hedgehog-transpiler'; const code = `const greet = (name) => { return \`Hello, \${name}!\`; }; console.log(greet('World'));`; const result = transform(code, { target: 'es5' }); console.log(result.code); // Output: var greet = function(name) { return 'Hello, ' + name + '!'; }; console.log(greet('World'));
hedgehog --version
Debug
Known issues
breakingVersion 1.0.0 introduced ESM-only exports. CommonJS require() will throw an error.
fix
Use import syntax instead of require. If using Node.js, ensure type: 'module' in package.json or use .mjs extension.
affects: >=1.0.0
gotchaThe default export is the transform function, not a bundled object. This differs from many other transpiler libraries.
fix
Import the transform function directly: import hedgehog from 'hedgehog-transpiler' instead of import { transform } from 'hedgehog-transpiler'.
affects: >=1.0.0
gotchaThe package does not include any built-in presets or plugins. It only supports basic JSX and modern syntax transformations.
fix
If you need advanced features (e.g., decorators, TypeScript), consider using Babel instead.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'hedgehog-transpiler'
The package is not installed or the import path is incorrect.
fix
Run npm install hedgehog-transpiler and ensure your import uses the correct path: import { transform } from 'hedgehog-transpiler'.
transform is not a function
Using named import instead of default import incorrectly.
fix
Use import hedgehog from 'hedgehog-transpiler' or import { transform } from 'hedgehog-transpiler' if you want the named export.
SyntaxError: Unexpected token 'export'
Running in an environment that doesn't support ESM (e.g., Node.js without type: 'module' or using .cjs extension).
fix
Switch to ESM by adding 'type': 'module' to package.json or use .mjs file extension.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
hedgehog-transpiler — npm install hedgehog-transpiler · libregistry