honey-badger-cli

raw JSON →
0.0.3 verified Fri May 01 auth: no javascript abandoned

HoneyBadger is a WIP ES2015+ to ES5 transpiler, bundler, and minifier written in Rust. This package provides a command-line interface and programmatic API (default export Badger class) for the Rust core. Version 0.0.3 wraps HoneyBadger 0.2.1. It is an experimental tool with limited ecosystem support, providing transform (transpile plus optional minify) and parse (AST) operations. No recent updates; likely abandoned.

error Error: Cannot find module 'honey-badger-cli'
cause Package not installed or native module failed to build.
fix
Run npm install honey-badger-cli and ensure Rust/node-gyp dependencies installed.
error TypeError: Badger is not a constructor
cause Using CommonJS require without .default to get the class.
fix
Use const Badger = require('honey-badger-cli').default or switch to ES import.
error honey-badger-cli: command not found
cause Global install may have failed or PATH not set.
fix
Install globally with npm install -g honey-badger-cli or use npx.
gotcha Package is a wrapper around a Rust binary via node-gyp. Native compilation may fail on unknown platforms.
fix Ensure Rust toolchain and node-gyp prerequisites are installed. Consider using Docker.
gotcha The exported Badger class expects to be instantiated; calling Badger.process() without 'new' might throw.
fix Always use `new Badger()` before calling methods.
gotcha The default export is a class, not a function. CommonJS users may mistakenly require as a function.
fix Use `const Badger = require('honey-badger-cli').default` or use ES import.
npm install honey-badger-cli
yarn add honey-badger-cli
pnpm add honey-badger-cli

Shows programmatic usage: create Badger instance, call transform with a string and minify=true, and CLI usage with --string.

import Badger from 'honey-badger-cli';
const instance = new Badger();
const code = 'const x = 1;';
const result = instance.badger.transform(code, true);
console.log(result);

// CLI usage:
// $ honey-badger-cli --string "const x = 1;" --pretty