Registry / web-framework / puppy-transpiler

puppy-transpiler

JSON →
library1.0.5jsnpmunverified

Puppy Transpiler is a lightweight JavaScript/TypeScript transpiler that translates modern ES2020+ code to ES2015 for broader browser compatibility. Version 1.0.5 is the latest stable release, with monthly updates. It differentiates by supporting inline TypeScript without configuration and producing minimal output. Ships TypeScript types.

npm install puppy-transpiler
INSTALL
IMPORT
SIG · PUPPY-TRANSPILER
P
puppy-transpiler
web-frameworkjavascriptv1.0.5
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.

transpile
import { transpile } from 'puppy-transpiler'
const transpile = require('puppy-transpiler')
ESM-only; CommonJS require() will return an empty object.
default
import transpile from 'puppy-transpiler'
const { transpile } = require('puppy-transpiler')
Default export is the transpiler function itself.
TranspileOptions
import { TranspileOptions } from 'puppy-transpiler'
import { TranspileOptions } from 'puppy-transpiler/types'
Type is exported from the main entry, not a subpath.

Transpiles an ES2020 arrow function to ES2015 using puppy-transpiler.

import { transpile } from 'puppy-transpiler'; const es2020 = `const add = (a, b) => a + b;`; const result = transpile(es2020, { target: 'es2015' }); console.log(result.code); // Output: var add = function(a, b) { return a + b; };
puppy --version
Debug
Known issues
breakingVersion 1.0.0 changed default target from 'es2016' to 'es2015'.
fix
Explicitly set 'target' option if you need a different target.
affects: >=1.0.0
gotchaTranspiler cannot handle dynamic imports; will throw a syntax error.
fix
Use a bundler or another transpiler for dynamic imports.
affects: >=0.9.0
deprecatedOption 'module' is deprecated; use 'target' to control module output.
fix
Replace 'module: 'cjs'' with 'target: 'es2015''.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'puppy-transpiler'
Package not installed or wrong import path.
fix
Run 'npm install puppy-transpiler' and ensure import is from 'puppy-transpiler'.
TypeError: transpile is not a function
Using default import incorrectly or wrong import style.
fix
Use 'import transpile from 'puppy-transpiler'' or 'import { transpile } from 'puppy-transpiler''.
SyntaxError: Unexpected token 'export'
Input contains ES modules syntax but target is set to a version that doesn't support it.
fix
Set 'target' to 'es2015' or higher to allow export statements.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

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