current-line
v1.0.1
Published
Get current filename, function name and line number
Downloads
1,000
Maintainers
Readme
current-line
Get current filename, function name and line number
Simple to use
const currentLine = require("current-line");
function go() {
console.log(currentLine.get());
}
go();
Output:
{
"method": "go",
"line": 4,
"file": "/home/user/current-line/tests/sample.js",
"filename": "sample"
}
Documentation
Last stack item
currentLine.get() : <StackItem>
Stack item by index
currentLine.get(1) : <StackItem>
All Stack item
currentLine.all() : <StackItem[]>