# what-line-is-this

> Output a message prefixed with the name and line number of the source file where you outputted the message

Latest version **2.0.0** (published 2019-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install what-line-is-this
pnpm add what-line-is-this
yarn add what-line-is-this
bun add what-line-is-this
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-10-16 |
| First published | 2015-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/what-line-is-this
- Repository: https://github.com/mafintosh/what-line-is-this
- Issues: https://github.com/mafintosh/what-line-is-this/issues
- npm.io page: https://npm.io/package/what-line-is-this

## Dependencies (1)

- [stackback](https://npm.io/package/stackback.md) 0.0.2

## Recent versions

- 2.0.0 (latest) — 2019-10-16
- 1.0.1 — 2015-01-30
- 1.0.0 — 2015-01-30

## README

# what-line-is-this

Output a message prefixed with the name and line number
of the source file where you outputted the message

```
npm install what-line-is-this
```

[![build status](http://img.shields.io/travis/mafintosh/what-line-is-this.svg?style=flat)](http://travis-ci.org/mafintosh/what-line-is-this)

## Usage

Assuming the following file is saved as `/Users/maf/index.js`

``` js
var what = require('what-line-is-this')

var foo = function () {
  what('line is this?')
}

what('line is this?')
foo()
```

Running it will produce the following output

```
/Users/maf/index.js:4 - line is this?
/Users/maf/index.js:7 - line is this?
```

If you wanted to output the line of the calling method instead use `what.stack(pos)`
to change the stack frame being used.

``` js
var what = require('what-line-is-this').stack(1)

var foo = function() {
  what('line is this?')
}

foo()
```

Running the above will print

```
/Users/maf/index.js:7 - line is this?
```

## License

MIT

---
_Source: https://npm.io/package/what-line-is-this · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
