Registry / devops / sequelize-log-syntax-colors

sequelize-log-syntax-colors

JSON →
library2.1.3-0jsnpmunverified

A simple npm package (version 2.1.3-0) that provides color highlighting for Sequelize SQL log output, focusing on basic MySQL syntax. It uses regular expressions to colorize SQL queries in the console, making them more readable. The package is lightweight with no production dependencies, though it requires a logging framework integration (e.g., console.log or Winston). Compared to alternatives like sequelize-logger or custom formatters, it offers a zero-config approach specifically for colorizing Sequelize logs. The project is in maintenance mode with infrequent updates, last published in 2016.

npm install sequelize-log-syntax-colors
INSTALL
IMPORT
SIG · SEQUELIZE-LOG-SYNT
S
sequelize-log-syntax-colors
devopsjavascriptv2.1.3-0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const colors = require('sequelize-log-syntax-colors');
CommonJS default import; ESM not supported directly.
default
import colors from 'sequelize-log-syntax-colors';
import { colors } from 'sequelize-log-syntax-colors';
Only default export exists; named import will fail.
default
const colors = require('sequelize-log-syntax-colors').default;
const colors = require('sequelize-log-syntax-colors');
In TypeScript with esModuleInterop: false, use .default. Otherwise plain require works.

Integrates the color highlighting with Sequelize's logging option to colorize SQL queries in the console.

const Sequelize = require('sequelize'); const colors = require('sequelize-log-syntax-colors'); const sequelize = new Sequelize('database', 'username', 'password', { host: 'localhost', dialect: 'mysql', logging: (msg) => console.log(colors(msg)) }); sequelize.authenticate() .then(() => console.log('Connection has been established successfully.')) .catch(err => console.error('Unable to connect to the database:', err));
Debug
Known issues
deprecatedPackage 'sequelize-log-syntax-colors' is deprecated by the author. Use other solutions like 'sequelize-logger' or custom formatters.
fix
Migrate to a maintained package or write a custom logging function.
affects: *
gotchaThe package targets Sequelize v3/v4; newer Sequelize versions (v5+) may change logging format or API, causing output to appear uncolored.
fix
Check message format in your Sequelize version; you may need to parse the log message before passing to colors().
affects: >=5.0.0
gotchaOnly MySQL-like SQL keywords are highlighted; other dialects (PostgreSQL, SQLite) may have incomplete coloring.
fix
Verify that SQL dialect keywords match the package's regex patterns.
affects: *
Errors
Common errors & fixes
Cannot find module 'sequelize-log-syntax-colors'
Package not installed or typo in package name.
fix
Run 'npm install sequelize-log-syntax-colors' and double-check spelling.
colors is not a function
Using named import 'colors' when only default export exists.
fix
Use 'import colors from 'sequelize-log-syntax-colors'' or 'const colors = require('sequelize-log-syntax-colors')'.
Upgrade
Version history
2.1.3-0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
sequelize-log-syntax-colors — npm install sequelize-log-syntax-colors · libregistry