@nanomatic/interpreter
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Interpreter

@nanomatic/interpreter

Status License


Interpreter implementation

📝 Table of Contents

🏁 Getting Started

Installing

npm i @nanomatic/interpreter

Using

Example code below:

import { Interpreter } from '@nanomatic/interpreter';

const variables: any = {
    memory: {
        pi: Math.PI,
        r: 2
    }
};

const interpreter = new Interpreter(variables, '|', (_: string, data: any[]) => data[1]);

const value = interpreter.parse('memory|result|surface = memory|pi * memory|r ** 2');

console.log(`π * r² = π * 2² = ${value}`);

// The same as bellow example
console.log(`π * r² = π * 2² = ${variables.memory.result.surface}`);

⛏️ Built With

✍️ Authors

🎉 Acknowledgments

  • Special thanks for Sebastian for working together and giving ideas 😉

Readme

Keywords

Package Sidebar

Install

npm i @nanomatic/interpreter

Homepage

nanomatic.pl

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.7 kB

Total Files

4

Last publish

Collaborators

  • nano_matic