Helper for editing Morphagene
options.txt
files
npm install --save @nutriot/morphagene-options
// all environments
import { parse, stringify, type MorphageneOptions } from '@nutriot/morphagene-options'
// NodeJS only
import { parseFile } from '@nutriot/morphagene-options/fs'
// Bonus: schemas for Valibot and Zod
import { valibotSchema, zodSchema } from '@nutriot/morphagene-options'
Usage: parse(optionsString, strict = true)
Parses an options string into a JavaScript object.
Usage: stringify(optionsObject, strict = true)
Stringifies a JavaScript object into an options string
Caution
The following methods do not work in the browser
Parses an options.txt
file into a JavaScript object.
Usage:
parseFile.sync('options.txt', strict = true)
await parseFile.async('options.txt', strict = true)
This work is licensed under The MIT License.