Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@getlazy/common
Advanced tools
Common libraries and utilities for lazy
LazyLoggingLevels
Using this object ensures consistent logging levels across all lazy processes running in Node.
Use:
const common = require('@getlazy/common');
const winston = require('winston');
winston.addColors(common.LazyLoggingLevels.colors);
const logger = new winston.Logger({
// ...
levels: common.LazyLoggingLevels.levels
});
PackageLogger
External packages cannot know if logger
exists on the global level nor what are its levels. This replaces such logging efforts with emitting log
events and leaving it to the package's user to listen to these events.
Use:
const common = require('@getlazy/common');
const logger = common.createLogger('my-package'); // We never assign this `logger` to `global` as that would overwrite application's `global.logger`.
// ...
logger.info('Succeeded marvelously.'); // This will emit `log` event. For users to listen to it logger needs to be exported from the package (see next example)
Forwarding log events:
const myPackage = require('my-package');
// This now forwards log events from my-package to Winston.
myPackage.logger.on('log', (level, packageName, ...args) => {
// In this example we put the package name into meta, if such exists.
const argsWithoutMeta = [...args];
const meta = argsWithoutMeta.pop();
if (typeof(meta) === 'object') { // Nah, not really, use lodash!
if (!meta._packageName) {
meta._packageName = packageName;
}
}
logger.log(level, ...messages, meta);
})
FAQs
Common utility classes and functions for lazy
The npm package @getlazy/common receives a total of 0 weekly downloads. As such, @getlazy/common popularity was classified as not popular.
We found that @getlazy/common demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.