0.0.5 • Published 2 years ago

@theroyalwhee0/sleepyjs v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

@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.

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