🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

coffeefuck

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffeefuck

BrainFuck interpreter written in CoffeeScript

1.0.3
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

CoffeeFuck

A BrainFuck interpreter written in CoffeeScript.

Installation

npm install --save coffeefuck

Usage

const coffeefuck = require('coffeefuck');
const result = coffeefuck('++++++++[->+++++<]');
console.log(result.memory);

Return

const {
    output,     // Array of the bytes extracted with "."
    memory,     // Array of the memory
    timeout,    // True if the time exceeded the timeout
    time,       // The time that it took (will be similar to the timeout if set)
} = coffeefuck('++[->+<]');

Options

options.length

Defines the maximal length of memory. (default: 2**32-1)

const result = coffeefuck('+>+>+>+>+>+', { length: 3 });
console.log(result);

options.size

Defines the size of the bytes in the memory. (default: 2**8)

const result = coffeefuck('-', { size: 2**16 });
console.log(result);

options.timeout

Stops running the BrainFuck interpretation after a specific time in milliseconds. (default: Infinity)

const result = coffeefuck('+[]', { timeout: 500 });
console.log(result);

options.inputs

If you know what BrainFuck is, then you know for what this is for. (default: [])

const result = coffeefuck(',[->+<],', { inputs: [69,21] });
console.log(result);

options.async

Returns a promise instead of running synchronously. (default: false)

Note: This makes the interpretation slower.

const result = await coffeefuck('+[>+[>+[+]<+]+[+]<+]', { async: true });
console.log(result);

Keywords

brainfuck

FAQs

Package last updated on 19 Nov 2021

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