1.0.0 • Published 1 year ago

bfcomp v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

⚙️ Installation

npm i bfcomp

CDN Links:

📖 Usage

◎ Import

// ES6
import bfcomp from "bfcomp";

// commonjs
const bfcomp = require("bfcomp");

◎ Compile / To text

const code = "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.";

const text = bfcomp.compile(code);
const text2 = bfcomp.toText(code);

console.log(text); // "Hello World!"
console.log(text2); // "Hello World!"

◎ Run

// code variable declared in the previous example
bfcomp.run(code);

This will console.log() the compiled BF code.

◎ To code

const code = bfcomp.toCode("Hello!");

console.log(code); // returns BF code
const code = bfcomp.toCode("Hello!");

bfcomp.run(code);

Support me on Patreon - Check out my socials