{"id":26142,"library":"ratel","title":"HoneyBadger CLI","description":"HoneyBadger CLI is a command-line interface and programmatic API for HoneyBadger, a Rust-based ES2015+ to ES5 transpiler, bundler, and minifier. Version 1.0.1 provides both a CLI with version, help, file/string input, output, minification toggle, and AST printing options, as well as a JavaScript API via the default export Badger class with methods like getVersion(), getUsage(), process(options), and access to a native rust module with transform() and parse(). This package is experimental and not suitable for production; it uses native Rust bindings and has infrequent updates (last release 1.0.1, previous 0.0.3). Key differentiator: Rust performance for transpilation vs Babel or esbuild, but very early stage and limited features.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install ratel","lang":"bash","label":"npm"},{"cmd":"yarn add ratel","lang":"bash","label":"yarn"},{"cmd":"pnpm add ratel","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a default class Badger, not a named export. Named import will be undefined.","wrong":"import { Badger } from 'honey-badger-cli'","symbol":"Badger","correct":"import Badger from 'honey-badger-cli'"},{"note":"The transform method is accessed via the badger property of an instance, not directly imported.","wrong":"import { transform } from 'honey-badger-cli'","symbol":"instance.badger.transform","correct":"import Badger from 'honey-badger-cli'; const instance = new Badger(); instance.badger.transform(string, minify)"},{"note":"process is an instance method, not a standalone function.","wrong":"const result = process({ file: './input.js' })","symbol":"instance.process","correct":"import Badger from 'honey-badger-cli'; const instance = new Badger(); instance.process({ file: './input.js' })"}],"quickstart":{"code":"import Badger from 'honey-badger-cli';\n\nconst instance = new Badger();\n\nconsole.log(instance.getVersion());\n\nconst result = instance.process({\n  string: 'const x = () => 1;',\n  pretty: true\n});\n\nconsole.log(result);\n\nconst minified = instance.badger.transform('const x = () => 1;', true);\nconsole.log(minified);","lang":"javascript","description":"Shows how to import the default Badger class, create an instance, use getVersion, process a string with pretty formatting, and use the native transform method to minify."},"warnings":[{"fix":"Use default import: import Badger from 'honey-badger-cli'","message":"Importing the package as a named import yields undefined.","severity":"breaking","affected_versions":">=0.0.2"},{"fix":"Ensure the native module is built properly; if not, instance.badger may be undefined.","message":"The badger property is only available after instantiation and requires native Rust bindings to compile.","severity":"gotcha","affected_versions":">=0.0.2"},{"fix":"Consider using Babel, swc, or esbuild for production use.","message":"The package is experimental and relies on the HoneyBadger Rust project, which may not be actively maintained.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Do not rely on AST output for production code.","message":"The --ast output format and process options are not guaranteed to be stable across versions.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install honey-badger-cli' and ensure you are using the correct import path.","cause":"The package may not be installed or the module resolution path is incorrect.","error":"Cannot find module 'honey-badger-cli'"},{"fix":"Change to: import Badger from 'honey-badger-cli'","cause":"Using a named import instead of default import.","error":"TypeError: (0 , _honeyBadgerCli.default) is not a constructor"},{"fix":"Pass either { file: 'path' } or { string: 'code' } to process().","cause":"The process() method requires either 'file' or 'string' option.","error":"Error: No input provided."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}