@theroyalwhee0/sleepyjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@theroyalwhee0/sleepyjs

Sleepy Script JS

What is this?

Sleepy Script JS is an implementation of Sleep Script in TypeScript/JavaScript.

Sleepy Script is a simple scripting system meant to be used when building lists of actions with parameters and a single shared state. It does not support basic language features like functions, branches, or loops.

Installation

npm i @theroyalwhee0/sleepyjs

Examples

# Single line comments are supported.
# They may not be mixed with content.

# The first string in a bracket set is the command name. 
# Here 'print' would be supplied by the caller.
[ "print", "Hello World!" ]

# Commands starting with '$' are set commands.
# The next line sets 'John Doe' with the key 'name' in the global state.
[ "$name", "John Doe" ]

# Commands starting with '@' are language commands.
# This is a noop.
[ "@noop" ]

# Empty lines and empty bracket sets are noops.
[]

# Tabs and spaces are ignored outside of strings.
      [   ]

# Trailling commas are allowed.
[ "$counter", 1 ],

# Values may be any valid JSON type, without newlines.
[ "print", { "this-is-an-object": true } ]

Links

Legal & License

Copyright 2022 Adam Mill

This library is released under Apache 2 license. See LICENSE for more details.

Dependents (0)

Package Sidebar

Install

npm i @theroyalwhee0/sleepyjs

Weekly Downloads

1

Version

0.0.5

License

none

Unpacked Size

116 kB

Total Files

83

Last publish

Collaborators

  • theroyalwhee0