npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yx-qrcode

v1.0.0

Published

一个功能强大的二维码生成器,支持多种样式、渐变、码眼自定义等特性

Readme

@impression/qrcode-generator

一个功能强大的二维码生成器库,支持多种样式、渐变、码眼自定义等特性。

特性

  • 🎨 支持多种码眼样式(20+种)
  • 🌈 支持线性渐变和径向渐变
  • 🎯 支持码眼外圈和中心独立颜色设置
  • 📐 支持自定义模块大小、边距、缩放
  • 🔧 TypeScript 支持
  • 📦 零依赖(除核心编码库)

安装

npm install @impression/qrcode-generator

快速开始

import { createQrcode } from '@impression/qrcode-generator';

// 基础用法
const svg = await createQrcode('Hello World', {
  moduleSize: 10,
  color: '#1976d2',
  background: '#ffffff',
});

// 使用渐变
const svg = await createQrcode('Hello World', {
  colorGradient: 'to right #ff6600 #ff0066',
  background: '#ffffff',
});

// 自定义码眼样式
const svg = await createQrcode('Hello World', {
  finderShape: 'circle',
  eyeShape: 'star',
  color: '#000000',
  background: '#ffffff',
});

API 文档

createQrcode(text, config)

生成二维码并返回 SVG 字符串。

参数

  • text (string): 要编码的文本内容
  • config (Partial): 配置对象

配置选项

  • level ('L' | 'M' | 'Q' | 'H'): 错误纠正级别,默认 'L'
  • moduleSize (number): 每个模块的像素大小,默认 10
  • margin (number): 边距(模块数),默认 0
  • scale (number): 整体放大倍数,默认 1.0
  • color (string): 前景颜色
  • colorGradient (string): 前景渐变(格式:'to right #ff0000 #00ff00' 或 'radial #ff0000 #00ff00')
  • background (string): 背景颜色
  • backgroundGradient (string): 背景渐变
  • finderShape (string): 码圈样式,默认 'default'
  • eyeShape (string): 码眼中心样式,默认 'default'
  • outerEyeColor (string): 码眼外圈颜色
  • innerEyeColor (string): 码眼中心颜色

支持的样式

Finder 样式(码圈)

  • default, flurry, sdoz, drop_in, drop, dropeye, circle, rounded, flower, leaf, vortex, dots, bruised, canvas 等

Eye 样式(码眼中心)

  • default, circle, star, diamond, heart, sun, vortex, sparkle_dot, 9-dots, flower, elastic, diagonal, ropes 等

许可证

MIT