v2.0.0
v2.0.0 is a significant release — logger-neue has been entirely rewritten in strict TypeScript. On top of an improved API and providing a stronger developer experience with its included type definitions, several minor potential bugs were fixed during the rewrite.
Since this is a major release, there are several breaking changes:
-
Minimum supported Node version of 6
-
importusageThe default export is now a function rather than the
LoggerNeueclass — which is now a separate named export if you need it.import loggerNeue, { LoggerNeue } from 'logger-neue' const log = loggerNeue() const log2 = new LoggerNeue()
However be aware that these are not exactly equivalent for TypeScript users. The function is a wrapper around the class that serves to provide more accurate type definitions based on the level descriptors you provide at construction time.
const log = loggerNeue({ levels: { greet: [0, 'red'] } }) // you'll get type hints on this! log.greet('hi!')
-
ES5 / commonjs
requireES5 / commonjs users will need to use the
.defaultproperty when
requireing:const loggerNeue = require('logger-neue').default
-
level descriptors
When defining new levels using object syntax, the property formerly known as
colorsis now calledstyleto better reflect thatchalkstyles other than colors such asunderlineandboldare also accepted.
FEATURES
- rewrite in TypeScript (80dacc8)
BREAKING CHANGES
colorsin level descriptor objects is now known asstyle.- the default export is no longer a class, but instead is a function. The class is now a named export.
- non-ES module / TS users must use
require('logger-neue').default. - support for Node < 6 has been dropped.