Giter Site home page Giter Site logo

ngogiaphat / vitepluginturboconsole Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unplugin/unplugin-turbo-console

0.0 0.0 0.0 1.24 MB

๐Ÿš€ Enhance the ability of `console.log()`

License: MIT License

JavaScript 0.86% TypeScript 34.04% CSS 10.56% HTML 4.58% Vue 49.96%

vitepluginturboconsole's Introduction

๐ŸŽฅ Screen Recording

gif

๐Ÿ”ฅ Features

  • Support printing the file name, line number and variable name.

  • Support background highlighting of different files. (Currently supporting .js(x), .ts(x), .vue, .svelte)

  • Support jump to editor from console by simple click.

๐Ÿ“ฆ Install

# npm
npm install -D vite-plugin-turbo-console
# yarn
yarn add -D vite-plugin-turbo-console
# pnpm
pnpm i -D vite-plugin-turbo-console

๐Ÿฆ„ Usage

Vite

vite.config.ts

import { defineConfig } from "vite";
import TurboConsole from "vite-plugin-turbo-console";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    TurboConsole({
      /* options here */
    })
  ],
});

Nuxt

nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  modules: [
    'vite-plugin-turbo-console/nuxt'
  ],
  turboConsole: {
    /* options here */
  }
})

options

export interface Options {
  /**
   * Add a string prefix to the console log.
   *
   * @default ''
   */
  prefix?: string
  /**
   * Add a string suffix to the console log.
   *
   * @default ''
   */
  suffix?: string
  /**
   * Whether to disable the launch editor feature.
   *
   * @default false
   */
  disableLaunchEditor?: boolean
}

โค๏ธ Credits

Inspired by

babel-plugin-enhance-log

turbo-console-log

vite-plugin-console-line

vitepluginturboconsole's People

Contributors

yuyinws avatar 17359898647 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.