
Js-tokens provides a regex with the g flag that matches JavaScript tokens. The regex always matches, even invalid JavaScript and the empty string. The next match is always directly after the previous.
Node.js is an event-based server-side JavaScript engine.