babel-plugin-source-line
v1.0.1
Published
This plugin displays source code lines
Downloads
3
Readme
babel-plugin-source-line
This plugin displays source code lines
Example
In
// index.js
console.log("test")
Out
console.log('index.js (1:0)', 'test')
Installation
npm install babel-plugin-source-line --save-dev
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["source-line"]
}
{
"plugins": [
["source-line", {
"segments": 0,
"splitSegment": "/"
}]
]
}
Via CLI
babel --plugins source-line script.js
Options
segments
- Display file path- 0 full file path (Default)
- 1 The file name only displays the file name
- 2 file name and last segment
splitSegment
- How to split the path; windows user '\', linux macOS use /color
- Display background color default false