@hakerh400/esolangs

1.4.18 • Public • Published

Esolangs

This is a collection of interpreters for esoteric programming languages.

Number of languages: 80

How to install

First install Node.js version 16.2.0 or newer, then run:

npm i @hakerh400/esolangs

It will create folder node_modules and @hakerh400/esolangs inside it.

How to run

CLI

To run this program as a console application, open command line, navigate to the node_modules/@hakerh400/esolangs directory and type:

node index <language> <source> <input> <output>
  • <language> - the ID (not the name) of the esoteric language you want to use. For the list of supported languages and their IDs see esolangs.json.
  • <source> - path to the file containing the source code of the program you want to run.
  • <input> - path to the file containing program's standard input.
  • <output> - path to the file which the program's output will be written into. The file will be overwritten if exists.

For output-only languages the <input> parameter should be omitted.

For languages that support interactive mode (see api.md for details) you can
replace <input> <output> with --interactive flag. The standard input and output will be used instead of files.

If any error occurs, it will be written to the console and the output file will not be created.

API

Example of using @hakerh400/esolangs in a Node.js application:

'use strict';

const esolangs = require('@hakerh400/esolangs');

const lang = 'brainfuck';
const source = '+[-->-[>>+>-----<<]<--<---]>-.>>>+.>>..+++[.>]<<<<.+++.------.<<-.>>>>+.';
const input = '';
const output = esolangs.run(lang, source, input);

console.log(output.toString());

For the full API documentation, see api.md.

Contributing

See contributing.md.

Mirrors

Package Sidebar

Install

npm i @hakerh400/esolangs

Weekly Downloads

86

Version

1.4.18

License

Unlicense

Unpacked Size

1.08 MB

Total Files

610

Last publish

Collaborators

  • hakerh400