source-line
v1.0.3
Published
This plugin displays source code lines
Downloads
3
Readme
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 source-line --save-dev
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["module:source-line"]
}
{
"plugins": [
["module: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