@skitscript/mapper-nodejs
v2.0.0
Published
A Skitscript document mapper targeting NodeJS.
Downloads
13
Readme
Skitscript Mapper (NodeJS)
A Skitscript document mapper targeting NodeJS.
Installation
Dependencies
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.
Install as a runtime dependency
If your application uses this as a runtime dependency, install it like any other NPM package:
npm install --save @skitscript/mapper-nodejs
Install as a development dependency
If this is used when building your application and not at runtime, install it as a development dependency:
npm install --save-dev @skitscript/mapper-nodejs
Usage
Parsing documents
Import the map
function, and provide it with a parsed document to receive a
map of all reachable game states:
import { map } from "@skitscript/mapper-nodejs";
const mapResult = map(parsedDocument);
console.log(mapResult);
{
"type": "valid",
"states": [...]
}
Types
A comprehensive library of types representing the results of attempting to map parsed documents can be imported:
import { Map } from "@skitscript/mapper-nodejs";
Maps
States
Characters
- EnteringMapStateCharacter
- ExitingMapStateCharacter
- MapStateCharacter
- NotPresentMapStateCharacter
- PresentMapStateCharacter