The software is implemented as a compiler to ensure reliable, and comes with a full test suite.
How JSlite Works
Under the hood, the software processes are split into a number of stages:
The tokens are passed to the parser which then loops through and consumes each token through an object based Finite State Machine to create an internal object structure that represents the document. This enables irregular tokens to be ignored and the document to be parsed with more reliability.
Once parsed, the AST will contain an array of child objects each representing each expression, variable, and structure, which will in turn have their own child expressions, functions and variables.
Minification is performed by each object on its own structure, the command passed down each level from the one above.
For the most part the object is memory efficient, most memory will be used by the tokenisation process, which uses a regular expression to split the input string into tokens. This part of the program has been optimised to minimise the amount of memory used.
You can try out JSlite in my apps.