Using Recast to Automate Analysis and Maintenance of JS Code

Originally published at: Recast is a great library for parsing and modifying JavaScript code. The result of the parsing is an Abstract Syntax Tree (AST) which is easy to traverse and analyze. Once a tree is built, it’s easy to modify it and convert back to the source code. Additionally, Recast provides methods for […]

Executing JavaScript Code in a Sandbox Using Node’s VM Module

The API of Node exposes a module called VM that allows for a more safe execution of arbitrary JS code. The module operates in terms of scripts, sandboxes and contexts. Scripts are objects that represent compiled versions of JS code. Sandboxes are plain JS objects that will be bound to a script before the script […]