SkillAgentSearch skills...

InfiniteLoopBuster

Using Esprima to stop infinite loops before they happen.

Install / Use

/learn @codepen/InfiniteLoopBuster
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Infinite Loop Buster!

Stop infinite loops before they happen.

This takes a string of JavaScript and alters it to ensure that infinite loops are broken, but otherwise doesn't affect the code. The purpose is so you can run it without fear of freezing the browser. Online code editors like CodePen are the use-case.

This uses Esprima to create an abstract syntax tree out of the JavaScript and do the instrumenting. Esprima is the only dependency, it doesn't require any additional libraries to output back to a string of JavaScript.

Ariya Hidayat is the creator of Esprima, and largely wrote this version of the Infinite Loop Buster as well. Thanks so much, Ariya!

Related Skills

View on GitHub
GitHub Stars65
CategoryDevelopment
Updated18d ago
Forks16

Languages

JavaScript

Security Score

80/100

Audited on Mar 13, 2026

No findings