
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@bicycle-codes/debug
Advanced tools
A tiny JavaScript debugging utility that works in Node.js and browsers. Use environment variables to control logging, so there are no ridiculous console log statements in production.
This is based on debug. It's been rewritten to use contemporary JS.
Featuring:
package.json to choose node JS or browser versionPlus, see the docs generated by typescript.
npm i -D @bicycle-codes/debug
Use this with vite in the browser or in node.
This is ergonomic with the vite bundler. This module will look for an env variable prefixed with VITE_:
VITE_DEBUG=fooo
If you initialize this without a namespace, then it checks import.meta.env.DEV:
import Debug from '@bicycle-codes/debug'
const debug = Debug()
debug('debug works') // check if `import.meta.env.DEV`
You can pass in an env variable of VITE_DEBUG_MODE, and then debug will
check for that mode in vite.
VITE_DEBUG_MODE=staging vite build --mode staging
Can parse a comma separated list of modes.
A .env file like this:
VITE_DEBUG_MODE="test, staging"
Will log in either "test" or "staging" modes, or if import.meta.env.DEV is true.
vite --mode staging build
If you are in production (import.meta.env.PROD) and there is no VITE_DEBUG env var, then this exports a noop, so debug will do nothing, and your bundle will be smaller.
In your JS code:
import { createDebug } from '@bicycle-codes/debug'
const debug = createDebug('fooo')
debug('debug works')
You would start that script with a VITE_DEBUG=fooo env var to see the log statements.
If you call this without a namespace argument, it will look at the value of import.meta.env.DEV. If you are in DEV mode, then it will log things in a random color:
import { createDebug } from '@bicycle-codes/debug'
const debug = createDebug('fooo')
const debug2 = createDebug()
debug('debug works')
debug2('testing debug 2')
setTimeout(() => {
debug2('log again')
}, 1000)

Run your script with an env variable, DEBUG.
// in node JS
import createDebug from '@bicycle-codes/debug/node'
const debug = createDebug('fooo')
debug('testing')
Call this with an env var of DEBUG=fooo
DEBUG=fooo node ./test/fixture/node.js
If you are in dev mode (process.env.NODE_ENV === 'development'), then this will log things in a random color if you don't initialize it with a namespace --
import createDebug from '@bicycle-codes/debug'
const debug = createDebug()
debug('hello')
Run the script like this:
NODE_ENV=development node ./my-script.js
Configure what NODE_ENV value will trigger logging by overriding the shoudlLog function:
// in node only
import Debug from '@bicycle-codes/debug'
Debug.shouldLog = function (NODE_ENV) {
return NODE_ENV === 'example'
}
const debug = Debug()
// this will log iff we start this like
// NODE_ENV="example" node my-program.js
debug('testing')
Start a vite server and log some things. This uses the example directory.
npm start
Run tests:
npm test
FAQs
Debug utility
The npm package @bicycle-codes/debug receives a total of 51 weekly downloads. As such, @bicycle-codes/debug popularity was classified as not popular.
We found that @bicycle-codes/debug 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.