1.0.1 • Published 5 years ago

current-line v1.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
5 years ago

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