Skip to content

Spectral Logs v0.1.9

Choose a tag to compare

@ZtaMDev ZtaMDev released this 14 Oct 22:39
· 38 commits to main since this release

v0.1.9 Release Notes

Fixed

  • Hex color parsing: Fixed an issue where hexadecimal colors with more than 6 characters (like #2bff00ff or #ffffff) were not being recognized. The hexToRgb function now properly handles 3, 6, and 8-character hex formats, ignoring the alpha channel when present.

  • CLI configuration enhancement: The CLI now generates a simple JavaScript configuration file called specConf.js containing a default configuration object that can be easily imported in Node.js, Bun, or other JavaScript environments.

Stuff you need to know

  • This release focuses on color consistency and developer experience improvements
  • No breaking changes to the core logging API
  • The new specConf.js file provides a more straightforward way to configure SpectralLogs across different JavaScript environments
  • Color parsing now supports all standard hex formats including those with alpha channels (though alpha is ignored for terminal output)

Install

  • Fresh install:
npm install spectrallogs
  • Update existing:
npm install spectrallogs@^0.1.9
  • or
npm update spectrallogs

Usage

After installation, you can generate the configuration file:

npx spec config set [parameter=value]

Then import it in your project:

For ESM (ECMAScript Modules):

import config from './specConf.js';

For CommonJS:

const config = require('./specConf.js').default;

Note: The configuration file uses export default for better compatibility with modern JavaScript environments. Use .default when importing with CommonJS require().

The generated specConf.js contains sensible defaults that you can customize for your project's logging needs.