@nutriot/morphagene-options
v0.3.3
Published
Helper for editing Morphagene `options.txt` files
Downloads
10
Maintainers
Readme
@nutriot/morphagene-options
Helper for editing Morphagene
options.txt
files
Installation
npm install --save @nutriot/morphagene-options
Usage
// all environments
import { parse, stringify, type MorphageneOptions } from '@nutriot/morphagene-options'
// NodeJS only
import { parseFile, parseFileSync } from '@nutriot/morphagene-options/fs'
// Bonus: schemas for Valibot and Zod
import { valibotSchema, zodSchema } from '@nutriot/morphagene-options'
parse
Usage: parse(optionsString, strict = true)
Parses an options string into a JavaScript object.
stringify
Usage: stringify(optionsObject, strict = true)
Stringifies a JavaScript object into an options string
parseFile
:warning: This function is only available in NodeJS
Parses an options.txt
file into a JavaScript object.
Usage: await parseFile('options.txt', strict = true)
parseFileSync
:warning: This function is only available in NodeJS
Usage: parseFileSync('options.txt', strict = true)
Parses an options.txt
file into a JavaScript object.
License
This work is licensed under The MIT License.