Registry / devops / brnfckr

brnfckr

JSON →
library0.1.1jsnpmunverified

A brainfuck minifier written in JavaScript, version 0.1.1. It reduces brainfuck code by removing non-command characters and optimizing redundant sequences. Supports multiple environments including browsers, Node.js, Narwhal, RingoJS, Rhino, and AMD loaders. Comes with a CLI binary. Tested on Chrome 27, Firefox 3-19, Safari 4-6, Opera 10-12, IE 6-10, Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, and Rhino 1.7RC4.

npm install brnfckr
INSTALL
IMPORT
SIG · BRNFCKR
B
brnfckr
devopsjavascriptv0.1.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.

brnfckr
var brnfckr = require('brnfckr');
import brnfckr from 'brnfckr';
The package does not ship an ES module; use CommonJS require(). As of version 0.1.1, no ESM exports exist.
minify
brnfckr.minify(code);
minify(code);
minify is a method on the exported object, not a named export. Must be called via the brnfckr object.
minify
var brnfckr = require('brnfckr'); brnfckr.minify(code);
const { minify } = require('brnfckr');
The minify function is not a separate export; destructuring fails because it's a property on the default export.

Demonstrates importing brnfckr and minifying a simple brainfuck program by removing non-command characters.

var brnfckr = require('brnfckr'); var code = 'lol . wat + heh [ huh . hah + oh ] yay'; var minified = brnfckr.minify(code); console.log(minified); // '.+[.+]'
Debug
Known issues
breakingPackage has no ES module support and uses `require` - will break in ESM-only environments.
fix
Use dynamic import() or CommonJS require. For Node.js, ensure type is not ESM.
affects: >=0.1.1
deprecatedUse of `var` for package assignment is outdated - consider `const`.
fix
Use `const brnfckr = require('brnfckr');`
affects: >=0.1.1
gotchaThe minify function only works with valid brainfuck commands (+-<>.,[]) and ignores all other characters.
fix
Understand that non-command characters are stripped; do not rely on them being preserved.
affects: >=0.1.1
gotchaNo TypeScript type definitions available - TypeScript users must declare module manually.
fix
Create a .d.ts file: declare module 'brnfckr' { export function minify(code: string): string; }
affects: >=0.1.1
Errors
Common errors & fixes
Error: Cannot find module 'brnfckr'
Package not installed or not in node_modules.
fix
Run `npm install brnfckr` to install the package.
TypeError: brnfckr.minify is not a function
Incorrect import style: using ES6 import syntax or destructuring incorrectly.
fix
Use `const brnfckr = require('brnfckr');` then `brnfckr.minify(code);`
SyntaxError: Unexpected token 'export'
Trying to import an ESM module from a package that doesn't support ESM.
fix
Use CommonJS require() instead of import.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
brnfckr — npm install brnfckr · libregistry