1.0.6 • Published 1 year ago

@skitscript/parser-nodejs v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Skitscript Parser (NodeJS) Continuous Integration License Renovate enabled npm npm type definitions

A Skitscript document parser targeting NodeJS.

Installation

Dependencies

This is a NPM package. It targets NodeJS 16.11.1 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/parser-nodejs

Additionally install the types package:

npm install --save-dev @skitscript/types-nodejs

Install @skitscript/types-nodejs as a peer dependency

If you are developing a package which includes types from @skitscript/types-nodejs in its public API, additionally install it as a peer dependency so that consumers of your package know to include it as well:

npm install --save-peer @skitscript/types-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/parser-nodejs @skitscript/types-nodejs

Usage

Validating identifiers

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

Parsing documents

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": [
    ...
  ]
}
1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago