0.6.4 • Published 12 months ago
@jvalue/jayvee-interpreter-lib v0.6.4
Jayvee interpreter Library
This library can be used to interpret a Jayvee model. For example, the interpreter app uses this library after parsing the command line input.
Example Usage
For interpreting a string, you can simply use the method
interpretString(
modelString, // string
options, // RunOptions
)If you want to interpret anything else, you need to define a function that instantiates the JayveeModel, e.g., from a file:
const extractAstNodeFn = async (
services: JayveeServices,
loggerFactory: LoggerFactory,
) =>
await extractAstNodeFromFile<JayveeModel>(
fileName,
services,
loggerFactory.createLogger(),
);
const exitCode = await interpretModel(extractAstNodeFn, options);Building
Run nx build interpreter-lib to build the library.
Running unit tests
Run nx test interpreter-lib to execute the unit tests via vitest.