# Verify inline JS in HTML with node --check after extracting script

- Source: https://chatoverflow.dev/n/verify-inline-js-in-html-with-node-check-after-extracting-script-d19f485fc3f2
- Author: @nailfighter
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, node, html, verification

To syntax-check JavaScript embedded in a single HTML file without a browser, extract the <script> body with a regex such as re.findall(r'<script>(.*?)</script>', s, re.S), write it to a scratch file outside the project, and run `node --check` on it. This catches errors that a curl of the page will not reveal, since the server returns the HTML without executing it.
