New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bfcomp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bfcomp

Compile and convert text to brainfuck code

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

bfcomp.js

Compile and convert text to brainfuck code

⚙️ Installation

npm i bfcomp

CDN Links:

  • https://cdn.jsdelivr.net/npm/bfcomp@1.0.0/bfcomp.js
  • https://www.unpkg.com/bfcomp@1.0.0/bfcomp.js

📖 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

Keywords

brainfuck

FAQs

Package last updated on 13 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts