All Projects → peteringram0 → babel-plugin-console-source

peteringram0 / babel-plugin-console-source

Licence: other
Add the file name and line numbers to all console logs.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to babel-plugin-console-source

Eslint Import Resolver Babel Module
Custom eslint resolve for babel-plugin-module-resolver
Stars: ✭ 236 (+521.05%)
Mutual labels:  babel-plugin
penv.macro
A macro used with babel-plugin-macros to write configurations for multiple environments, and remove configurations are irrelevant with the specified environment from your codes finally.
Stars: ✭ 73 (+92.11%)
Mutual labels:  babel-plugin
babel-plugin-solid-undestructure
A Babel plugin for SolidJS that allows you to destructure component props without losing reactivity.
Stars: ✭ 45 (+18.42%)
Mutual labels:  babel-plugin
S2s
Coding time Compile. A tool to write code fastest.
Stars: ✭ 254 (+568.42%)
Mutual labels:  babel-plugin
nornj
More exciting JS/JSX based on Template Engine, support control flow tags, custom directives, two-way binding, filters and custom operators.
Stars: ✭ 97 (+155.26%)
Mutual labels:  babel-plugin
idomizer
An HTML template parser compiling an incremental-dom render factory.
Stars: ✭ 15 (-60.53%)
Mutual labels:  babel-plugin
Babel Plugin Macros
🎣 Allows you to build simple compile-time libraries
Stars: ✭ 2,366 (+6126.32%)
Mutual labels:  babel-plugin
console-subscriber
Subscribe to the browser's console output.
Stars: ✭ 14 (-63.16%)
Mutual labels:  console-log
console log
A rust logger that routes messages to the browser's console.
Stars: ✭ 67 (+76.32%)
Mutual labels:  console-log
babel-plugin-solid-labels
Simple, reactive labels for SolidJS
Stars: ✭ 127 (+234.21%)
Mutual labels:  babel-plugin
babel-plugin-tailwind-rn
Allows you to use className="w-full md:w-1/2" syntax in your react native projects.
Stars: ✭ 31 (-18.42%)
Mutual labels:  babel-plugin
babel-plugin-hyperscript-to-jsx
This plugin transforms react-hyperscript into JSX. Intended to be used as codemod.
Stars: ✭ 20 (-47.37%)
Mutual labels:  babel-plugin
babel-plugin-transform-for-of-as-array
Transform all for-of loops into the equivalent array for loop
Stars: ✭ 14 (-63.16%)
Mutual labels:  babel-plugin
Xwind
Tailwind CSS as a templating language in JS and CSS-in-JS
Stars: ✭ 249 (+555.26%)
Mutual labels:  babel-plugin
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+139.47%)
Mutual labels:  console-log
Babel Plugin React Intl Auto
i18n for the component age. Auto management react-intl ID.
Stars: ✭ 203 (+434.21%)
Mutual labels:  babel-plugin
dd.js
Laravel dd() in JS
Stars: ✭ 51 (+34.21%)
Mutual labels:  console-log
babel-plugin-storybook-csf-title
A Babel plugin to generate titles for Storybook CSF stories at compile time, typically based on the story file's file name.
Stars: ✭ 17 (-55.26%)
Mutual labels:  babel-plugin
babel-plugin-transform-rename-properties
A Babel plugin for renaming JavaScript properties
Stars: ✭ 19 (-50%)
Mutual labels:  babel-plugin
babel-plugin-feature-flags
A babel transform for managing feature flags
Stars: ✭ 57 (+50%)
Mutual labels:  babel-plugin

Babel-plugin-console-source

Prepends file name and line numbers for each console command, based on the source files.

// app.js
class App() {
    constructor() {
        console.log('test')
    }
}
     
class App() {
    constructor() {
        console.log('app.js (3:8)', 'test')
    }
}

// test.js
class Test() {
    constructor() {
        console.log('test two')
    }
}
     
class Test() {
    constructor() {
        console.log('test.js (3:8)', 'test two')
    }
}

Usage

$ yarn add babel-plugin-console-source -D

.babelrc

{
    "plugins": [
        
        // consoleSource // No options required
        
        // You can pass in the following options
        ["console-source", {
        
            "segments": 1, // NOT REQUIRED
            // 0 = full file path (Default)
            // 1 = file name ONLY
            // 2 = file name and last segment
            
            "splitSegment": '/' // How to split the path - NOT REQUIRED
            // Default is / for Linux and OSX
            // Windows users can use "\\" here if needed
             
        }]
    ]
}

Notes

NPM Install: https://www.npmjs.com/package/babel-plugin-console-source

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].