Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
babel-plugin-captains-log
Advanced tools
Babel plugin that injects helpful details into console statements
babel-plugin-captains-log
injects helpful details into console statements.
Default bahavior:
Transforms
function add(a, b) {
- console.log(a, b);
+ console.log("simple.js(2:2)", "add:", "a", a, "b", b);
return a + b;
}
const subtract = (a, b) => {
- console.log(a, b);
+ console.info("simple.js(7:2)", "subtract:", "a", a, "b", b);
return a - b;
};
See the Roadmap for a future features and oppurtunities to contribute.
This is a Babel plugin so it requires Babel v6 to run.
This module is distributed using npm which comes bundled with node:
npm install --save-dev babel-plugin-captains-log
To include the plugin in your project, create or open your .babelrc file at the root of your project. Then, add namespaces to your plugin list:
{
plugins: ["captains-log"]
}
This option provides control over which console statments are adjusted. Methods is set within your .babelrc
as an array.
Default: ["debug", "error", "exception", "info", "log", "warn"]
{
plugins: [
["captains-log", {
methods: ['debug', 'info']
}]
]
}
Flags are values set for all methods and are used to turn that feature on or off. Flags are not merged with defaults to allow for maximum control.
Default: true
{
plugins: [
["captains-log", {
injectVariableName: true
}]
]
}
Default: true
{
plugins: [
["captains-log", {
injectScope: true
}]
]
}
Default: true
{
plugins: [
["captains-log", {
injectFileName: true
}]
]
}
MIT
Thanks goes to these wonderful people (emoji key):
Kyle Welch 💻 📖 ⚠️ |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Babel plugin that injects helpful details into console statements
The npm package babel-plugin-captains-log receives a total of 143 weekly downloads. As such, babel-plugin-captains-log popularity was classified as not popular.
We found that babel-plugin-captains-log 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.