
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
console-extend
Advanced tools
this acts as a proxy for the console object so that you can execute functions while also console.(log|warn|error)
Description: This module allows you to proxy the console.log,console.warn and console.error methods to add in your own function calls that are executed before the origial console(log|warn|error) (can all set it to not do the origional call at all).
Steps:
1. Include console-extend
2. Create a constructor file(or do it all in the file you will be logging from)
3. Call .console() to retireve new console object with proxied methods attached.
4. Replace origional console with new console returned.
Example:
consoleConstructor.js
var consoleProxy = require('./console-extend');
consoleProxy.log(function(arg) {
var tempArg = arg.replace(/\s/g, '');
console.error(tempArg);
},false)
consoleProxy.warn([
function() {
var args = Array.prototype.slice.call(arguments);
var sum = 0;
args.forEach(x => {
sum = sum+ x;
})
console.error(sum);
},
function() {
var args = Array.prototype.slice.call(arguments);
newArr = args.map(x => {
return (x % 2 === 0) ? 'even' : 'odd'
})
console.error(newArr)
}
],false);
module.exports = consoleProxy.console();
The above overrides console.log to console.error what was passed in without spaces && console.warn will return sum off all numbers that were arguments and an array showing if they started as even or odd.
Example in use:
test.js
//replace console object with the new one returned from consoleConstructor
console = require('./consoleConstructor');
//below should now replace all spaces in string
console.log('hiiowihefpoqwehif pqowhiefpoqwehifpo qweifh poqwehf')
//below should log out the sum of the numbers and also tell if each number is even or odd
console.warn(1,23,45,234234,3)
Methods included in console-extend:
.log([fn],shouldStillLog)
args:
firstArg: array of functions or a single function that will run before orig log.
secondArg: true or false that decideds if it should still do origional log at the end.
=====================
.warn([fn],shouldStillLog)
args:
firstArg: array of functions or a single function that will run before orig log.
secondArg: true or false that decideds if it should still do origional log at the end.
=====================
.error([fn],shouldStillLog)
args:
firstArg: array of functions or a single function that will run before orig log.
secondArg: true or false that decideds if it should still do origional log at the end.
=====================
.console()
args:none
returns new console object;
Things to note that are important:
FAQs
this acts as a proxy for the console object so that you can execute functions while also console.(log|warn|error)
The npm package console-extend receives a total of 0 weekly downloads. As such, console-extend popularity was classified as not popular.
We found that console-extend 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.