sql-strip-comments

JSON →
library 0.0.23 ·javascript
verified Jun 5, 2026

A zero-dependency library to remove line (-- ...) and block (/* ... */) comments from SQL code. Version 0.0.23 is the latest as of the metadata snapshot; the package sees low to moderate releases (last update appears 2020). Differentiators: it correctly ignores comments inside string literals, and does not treat adjacent operators like `--` as comment markers when inside double-quoted strings. Works in Node.js and browsers. Alternative to regex-based solutions that often break on edge cases with strings or multiline comments.