# babel-plugin-winston-source

> Winston: Prepends file name and line numbers for each logger command, based on the source files.

Latest version **2.0.1** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-winston-source
pnpm add babel-plugin-winston-source
yarn add babel-plugin-winston-source
bun add babel-plugin-winston-source
```

## 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.1 |
| Published | 2020-11-19 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | meteor199 |
| Maintainers | hanjianqiao |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-winston-source
- Repository: https://github.com/hanjianqiao/babel-plugin-winston-source
- Homepage: https://github.com/hanjianqiao/babel-plugin-winston-source#readme
- Issues: https://github.com/hanjianqiao/babel-plugin-winston-source/issues
- npm.io page: https://npm.io/package/babel-plugin-winston-source

## Recent versions

- 2.0.1 (latest) — 2020-11-19
- 2.0.0 — 2020-11-19

## README

# babel-plugin-winston-source

> Docs are not completed

Winston: Prepends file name and line numbers for each logger command, based on the source files.
> Note: you need to use: `logger.info(...args) to make it work`

### .bablerc
```js
{
  "plugins": [
    "babel-plugin-winston-source"
  ]
}
```

### your code
> winston log take two args: (message, meta), so zip messages into an array
```js
// src/view/app.js
class App() {
  constructor() {
    logger.log('test', 'foo', 'bar')//line no 20,column no 10
  }
}
```
```
↓ ↓ ↓ ↓ ↓ ↓
```
```js
class App() {
  constructor() {
    logger.log(['test', 'foo', 'bar'], {position: '[s.V/app.js (20:10)]'})
  }
}
```

---
_Source: https://npm.io/package/babel-plugin-winston-source · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
