A spec-compliant implementation of SQL LIKE pattern matching for Node.js (version 2.0.0). It supports % and _ wildcards with backslash escaping, matching JavaScript strings against SQL-like patterns. No external dependencies. Released as an ESM-only module since v2.0.0. Differentiators: lightweight, no dependencies, simple API with two functions (isSQLMatch, sqlToRegex) for direct comparison or reusable regex creation. Not actively maintained, but API stable.
npm install sql-matchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows both direct string matching with isSQLMatch and reusable regex with sqlToRegex, including wildcards and escaping.
Use import { ... } from 'sql-match' or update Node to >=12 (for ESM support) and switch to dynamic import.Use String.raw to avoid interpretation: isSQLMatch(String.raw`\t`, 't') returns true.
Use String.raw`\\` to match a single backslash.
Replace require('sql-match') with import { isSQLMatch } from 'sql-match'.Use import { isSQLMatch } from 'sql-match' instead of import sqlMatch from 'sql-match'.No dependency data recorded yet.