Miss any of our Open RFC calls?Watch the recordings here! »

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()

Install

npm i current-line

DownloadsWeekly Downloads

26

Version

1.0.1

License

MIT

Unpacked Size

12.6 kB

Total Files

13

Last publish

Collaborators

  • avatar