@nanomatic/interpreter
v1.0.1
Published
Interpreter implementation
Downloads
1
Readme
📝 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
- ts-node-dev - TypeScript Node Dev
- tsc-watch - The nodemon for TypeScript
- TSLint - TypeScript linter
- NodeJs - Test Environment
✍️ Authors
- @NANOmatic - Idea & Initial work
🎉 Acknowledgments
- Special thanks for Sebastian for working together and giving ideas 😉