yarnspinner2js
v0.1.1
Published
Converts a Yarn Spinner script string to a js object
Downloads
9
Maintainers
Readme
Yarn Spinner to Javascript Converter
Converts a Yarn Spinner script string to a js object
Installation:
npm i yarnspinner2js
Usage:
import { parseYarnSpinner } from "yarnspinner2js"
const result = parseYarnSpinner(yarnSpinnerString)
Settings:
You can pass the parsing settings with the second parameter like this:
const result = parseYarnSpinner(yarnSpinnerString, {
ignoreHeaderParameters: ["position"], // default: []
normalizeText: false, // default: true
})
ignoreHeaderParameters
— all header parameters whose names are present in the array will be ignored
normalizeText
— if true, all whitespace characters at the beginning and end of strings will be deleted, as well as duplicate spaces inside