@lynx-js/qrcode-rsbuild-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.3.6 • Public • Published

Rspeedy Logo

license

A Rsbuild plugin that generates and displays QR codes for Lynx bundles directly in the terminal.

Getting Started

npm install -D @lynx-js/qrcode-rsbuild-plugin

Usage

import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'

export default {
  plugins: [pluginQRCode()],
}

Options

schema

Type: (url: string) => string | Record<string, string>
Default: (url) => ({ http: url })

The schema option allows you to customize the URL format displayed in the QR code.

import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return `lynx://${url}?dev=1`
      },
    }),
  ],
})

You can also define multiple schemas to switch between them by pressing a in the terminal:

import { pluginQRCode } from '@lynx-js/qrcode-rsbuild-plugin'
import { defineConfig } from '@lynx-js/rspeedy'

export default defineConfig({
  plugins: [
    pluginQRCode({
      schema(url) {
        return {
          http: url,
          foo: `foo://lynx?url=${encodeURIComponent(url)}&dev=1`,
          bar: `bar://lynx?url=${encodeURIComponent(url)}`,
        }
      },
    }),
  ],
})

Documentation

Visit Lynx Website to view the full documentation.

Contributing

Contributions to Rspeedy are welcome and highly appreciated. However, before you jump right into it, we would like you to review our Contribution Guidelines to make sure you have a smooth experience contributing to this project.

License

Rspeedy is Apache-2.0 licensed.

/@lynx-js/qrcode-rsbuild-plugin/

    Package Sidebar

    Install

    npm i @lynx-js/qrcode-rsbuild-plugin

    Weekly Downloads

    5,018

    Version

    0.3.6

    License

    Apache-2.0

    Unpacked Size

    161 kB

    Total Files

    13

    Last publish

    Collaborators

    • lynxdev-admin
    • jianliang00