Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
anylogger-console
Advanced tools
.
This is an anylogger adapter for the console.
This package is meant for application projects that are using libraries using
anylogger
. By including this adapter in your project, all libraries using
anylogger
will automatically start to use the browser console as their logging framework.
index.html
<script src="https://unpkg.com/anylogger@1.0.6/anylogger.min.js"></script>
<script src="https://unpkg.com/anylogger-console@1.0.2"></script>
<script>(function(){ // IIFE
var log = anylogger('index.html')
log.info('Logging is simple!')
})()</script>
Install anylogger
and this adapter:
npm install --save anylogger anylogger-console
This package is meant for application projects. If you are writing a library to
be NPM installed into some other project, most likely you should not include
any adapter, but instead just use anylogger
directly.
The anylogger-console
adapter will modify the anylogger
factory in such a
way that the loggers it creates will be logging to the console.
To activate the adapter, include it in your application entry point.
main.js
require('anylogger-console')
main.js
import 'anylogger-console'
In your application module code, only use anylogger to stay framework independent:
my-module.js
import anylogger from 'anylogger'
const log = anylogger('my-module')
log('Logging is simple!')
This is helpful if you ever decide to factor out the application module into a separate library.
Add an issue in this project's issue tracker to let me know of any problems you find, or questions you may have.
© 2020 by Stijn de Witt. Some rights reserved.
Licensed under the MIT Open Source license.
The GZIP algorithm is available in different flavours and with different possible compression settings. The sizes quoted in this README have been measured using gzip-size by Sindre Sorhus, your mileage may vary.
FAQs
Anylogger adapter for the console
The npm package anylogger-console receives a total of 2,112 weekly downloads. As such, anylogger-console popularity was classified as popular.
We found that anylogger-console 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.