Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinniuwu/hanabrainfuckconverter
Simple app that converts string into brainfuck or brainfuck into string <3 made with love Technology: Node.js
https://github.com/shinniuwu/hanabrainfuckconverter
Last synced: 1 day ago
JSON representation
Simple app that converts string into brainfuck or brainfuck into string <3 made with love Technology: Node.js
- Host: GitHub
- URL: https://github.com/shinniuwu/hanabrainfuckconverter
- Owner: ShinniUwU
- License: unlicense
- Created: 2024-08-03T11:52:25.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-03T11:56:12.000Z (4 months ago)
- Last Synced: 2024-08-03T12:51:48.245Z (4 months ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hana's Brainfuck Converter
A Node.js application to convert strings to Brainfuck code and decode Brainfuck code back to strings. The application features a menu interface and uses `chalk` for styled terminal output.
## Features
- Encode strings into Brainfuck code
- Decode Brainfuck code into strings
- Styled terminal output with `chalk`## Prerequisites
- [Node.js](https://nodejs.org/) (version 16.x or later)
## Installation
1. **Clone the repository or download the code:**
```bash
git clone https://github.com/your-username/brainfuck-converter.git
cd brainfuck-converter
```2. **Install the required dependencies:**
```bash
npm install
```## Running the Application
### Using ES Modules
If your file is named with the `.mjs` extension:
1. **Run the application:**
```bash
node index.mjs
```### Using CommonJS (with `.js` extension)
If you prefer to use the `.js` extension, ensure `"type": "module"` is added to `package.json`. Here’s how to set it up:
1. **Update `package.json`:**
Make sure your `package.json` contains:
```json
{
"name": "brainfuck-generator",
"version": "1.0.0",
"main": "index.js",
"type": "module",
"scripts": {
"start": "node index.js"
},
"dependencies": {
"chalk": "^5.0.0"
}
}
```2. **Run the application:**
```bash
npm start
```## Usage
When you run the application, a menu will be displayed:
1. **Choose an option:**
- **1**: Encode a string to Brainfuck
- **2**: Decode Brainfuck to string
- **3**: Exit the application2. **Follow the prompts** to input your string or Brainfuck code based on your choice.
## Example
### Encoding
- **Input**: `"Hello"`
- **Output**: A Brainfuck code sequence that outputs `Hello`.### Decoding
- **Input**: Brainfuck code like `+[----->+++<]>.>+.+++++++..+++.`
- **Output**: The string decoded from the Brainfuck code.## Troubleshooting
- **Error [ERR_REQUIRE_ESM]**: Ensure you are using the correct file extension (`.mjs`) or have set `"type": "module"` in `package.json` if using `.js`.
- **SyntaxError: Cannot use import statement outside a module**: Check that your Node.js version supports ES Modules or that you have set up the project to use ES Modules correctly.