A language grammar for Transact-SQL (T-SQL) to be used with the highlight.js syntax highlighting library. Current stable version is 1.3.0, released under a maintenance cadence. It provides highlighting for T-SQL code in web pages or web apps. Unlike generic SQL grammars, this one specifically targets T-SQL keywords, built-in functions, data types, and system objects. It ships TypeScript type definitions and is designed as a third-party language module for highlight.js, requiring the parent library.
npm install highlight.js-tsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Imports and registers the T-SQL language grammar, then highlights a simple query string.
Install both: npm install highlight.js highlight.js-tsql
Either use CDN script OR import/register programmatically, not both.
Use exactly 'tsql' when calling hljs.registerLanguage or in class names.
Ensure you call hljs.registerLanguage('tsql', tsql); with the correct import.Use default import: import tsql from 'highlight.js-tsql';
Run npm install highlight.js.