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.
callback-logger
Advanced tools
Log callback results
npm install callback-logger
Supported options:
successColor
- (default: 'green') Color for success messages. See cli-color for a list of supported colorserrorColor
- (default: 'red') Color for error messageslogFunction
- (default: console.log
) Function to call to log a message. It should be of the form function(message)
traceErrors
- (default: true
) When an error occurs, append the error stack to the messageLog a message as a success
Log a message as an error. If err
is passed and options.traceErrors
is true, the stack trace will also be logged.
Return a function which logs the result of a callback of type (err, success)
. If err
is defined, errorMessage
is used, otherwise successMessage
is used.
Underscore templating may be used on successMessage
and errorMessage
. The variables err
and res
contain the result of the callback
An optional callback can be passed which is executed after the log messages.
var logger = require('callback-logger')();
fs.writeFile('file.txt', 'contents', logger.cb('Successfully wrote file', 'Error while writing file'));
glob('*.txt', logger.cb('Found <%= res.length %> files', 'Error on glob'));
logger.success('Done something');
logger.error('Something went wrong');
FAQs
Log callback results
The npm package callback-logger receives a total of 3 weekly downloads. As such, callback-logger popularity was classified as not popular.
We found that callback-logger 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.