A Skitscript document parser targeting NodeJS.
This is a NPM package. It targets NodeJS 20.14.0 or newer on the following operating systems:
- Ubuntu 22.04
- Ubuntu 20.04
- macOS 13 (Ventura)
- macOS 12 (Monterey)
- macOS 11 (Big Sur)
- Windows Server 2022
- Windows Server 2019
It is likely also possible to use this package as part of a web browser application through tools such as webpack. This has not been tested, however.
If your application uses this as a runtime dependency, install it like any other NPM package:
npm install --save @skitscript/parser-nodejs
If this is used when building your application and not at runtime, install it as a development dependency:
npm install --save-dev @skitscript/parser-nodejs
Import the identifierIsValid
function, and provide it with a string containing
a possible identifier:
import { identifierIsValid } from "@skitscript/parser-nodejs";
console.log(identifierIsValid(`Example Identifier`));
console.log(identifierIsValid(`???`));
true
false
Import the parse
function, and provide it with a string containing your
document's content:
import { parse } from "@skitscript/parser-nodejs";
const parsed = parse(documentContentString);
console.log(parsed);
{
"type": "valid",
"instructions": [
...
],
"warnings": [
...
],
"identifierInstances": [
...
]
}
{
"type": "invalid",
"errors": [
...
],
"warnings": [
...
],
"identifierInstances": [
...
]
}
A comprehensive library of types representing the results of attempting to parse documents can be imported:
import { Document } from "@skitscript/parser-nodejs";
- ClearInstruction
- EmoteInstruction
- EntryAnimationInstruction
- ExitAnimationInstruction
- Instruction
- JumpInstruction
- LabelInstruction
- LineInstruction
- LocationInstruction
- MenuOptionInstruction
- SetInstruction
- SpeakerInstruction
- Condition
- EveryFlagClearCondition
- EveryFlagSetCondition
- FlagClearCondition
- FlagSetCondition
- SomeFlagsClearCondition
- SomeFlagsSetCondition