current-line

1.0.1 • Public • Published

NPM version npm Build Status codecov dependencies Status Known Vulnerabilities

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[]>

Others documentations

Full API

Sample currentLine.get()

Sample currentLine.all()

Package Sidebar

Install

npm i current-line

Weekly Downloads

244

Version

1.0.1

License

MIT

Unpacked Size

12.6 kB

Total Files

13

Last publish

Collaborators

  • flaviolsousa