Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
a TypeScript decorator, to add console.log() to all methods and properties of a class.
deborator (DEBug decORATOR) is a TypeScript decorator, to add console.log() to all methods and properties of a TypeScript class.
If you find yourself writing a lot of console.log() entries during debugging, then deborator may save you time!
This can be especially useful when regular debugging via breakpoints is not really practical
examples:
developing drag'n'drop features in a browser since browsers like Chrome tend not to exit the 'dragging' state, if they hit a breakpoint
developing real-time sites, when debugging via breakpoints is not practical
note: deborator should NOT be deployed to Production (as there may be performance/security impact because of the logging)
Install deborator via yarn:
yarn add deborator
Import deborator into the TypeScript file, and apply the decorator to the class you want to debug:
import { deborator } from "deborator";
@deborator
class MyCalculator {
add(value: number) {
// ...
}
}
Now if you hit F12, you will see console log entries for your class:
>DB> new MyCalculator( 1 )
>DB> MyCalculator.add( 5 )
>DB> MyCalculator.add( 5 ) => ( {"value":6} )
To see deborator in action, you can get the source code and run the demo app.
git clone https://bitbucket.org/str/deborator
On a Windows box (Unix should be similar ...)
CD demo-app
install
run
sourcecode in git: https://bitbucket.org/str/deborator
npm package: https://www.npmjs.com/package/deborator
TypeScript decorators:
MIT
FAQs
a TypeScript decorator, to add console.log() to all methods and properties of a class.
The npm package deborator receives a total of 0 weekly downloads. As such, deborator popularity was classified as not popular.
We found that deborator 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
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.