Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
retrieve calling function/method information (tiny wrapper for callsite)
callee()
returns the CallSite
Object of the calling function. alias for callee(1)
callee(2)
returns the CallSite
Object of the calling function of the calling function.callee('MyClass')
returns the CallSite
Object of the calling function, method or type with the name 'MyClass'callee('MyClass', true)
same as the above, but caches the callsite index (WARNING: use this with caution)callee.invalidate()
invalidates the cached callsite indexconst callee = require('callee')
function a() {
console.log('a', callee().getFunctionName())
b()
}
function b() {
console.log('b', callee().getFunctionName())
c()
}
let c = () => {
console.log('c', callee(2).getFunctionName())
d()
}
let d = () => {
console.log('d', callee().getFunctionName())
}
a()
it prints out:
a null
b a
c a
d c
see: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/callsite/index.d.ts
getThis(): any;
getTypeName(): string;
getFunctionName(): string;
getMethodName(): string;
getFileName(): string;
getLineNumber(): number;
getColumnNumber(): number;
getFunction(): Function;
getEvalOrigin(): string;
isNative(): boolean;
isToplevel(): boolean;
isEval(): boolean;
isConstructor(): boolean;
getRelativeFileName(): string;
NOTE: getRelativeFileName()
is an added function
single dependency: callsite
MIT
Andi Neck
FAQs
retrieve calling function/method information
The npm package callee receives a total of 171 weekly downloads. As such, callee popularity was classified as not popular.
We found that callee 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.