Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Super simple, but solves these pain points:
localStorage.debug
is set.console
rather than trying to wrap it in something (which makes the output ugly).window.console
so the normal API applies.Step 1. include it:
<script src="andlog.js"></script>
Step 2. Use the console
in your code as usual:
console.log("hello");
Step 3. If you want to see log output set a value called debug
in localStorage
by doing typing this in console:
localStorage.debug = true
If you'd like to use a custom debug key then set localStorage.andlogKey = 'something-else'
and then set localStorage['something-else'] = true
to enable logging.
Step 4. Refresh the page, you should now see logs.
Step 5. To turn off console, just delete the localStorage flag:
delete localStorage.debug
Step 6. Feel free to deploy to production with console stuff in there.
If you're using this on the client but your project is in node.js you can install this with: browserify and npm.
var logger = require('andlog');
logger.log('hello');
This is identical to:
console.log('hello');
You could even get fancy and call it console
. However by doing this you take the risk that you'll forget to require
it and it'll still work and you'll ship it to production. However, obviously this would work as well:
var console = require('andlog');
console.log('hello');
1.0.2
bug fix to make sure ls
is always defined.MIT
If you like this, follow @HenrikJoreteg on the twitterwebz.
FAQs
Super-simple, client-side CommonJS logging thingy
The npm package andlog receives a total of 1,110 weekly downloads. As such, andlog popularity was classified as popular.
We found that andlog 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.