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

@showzhou/logo_qrcode

v1.1.0

Published

​ 依赖于qrcode

Downloads

19

Readme

生成带logo的二维码

描述

​ 依赖于qrcode

安装模块

yarn add @showzhou/logo_qrcode
或者
npm i @showzhou/logo_qrcode

使用

  • 导入
import { 
    createQrCodeAndLogo, createSmartQrcodeAndLogo,
    readQRCode,createQrCode 
} from '@showzhou/logo_qrcode';
  • 生成logo二维码
/** 
 *  不验证二维码是否可扫
 *  data: 存入数据 
 *  url: logo的连接
 **/
createSmartQrcodeAndLogo({
    data:JSON.stringify({
        name:'showzhou',
        age:20,
        address:{
            country:'China',
            city:'Heilongjiang',
            detailed:'No. 99-1, Shimao Avenue, Songbei District, Harbin City, Heilongjiang Province'
        }
    }),
    url:''
});

或者

/** 
 *  验证二维码是否可扫
 *  data: 存入数据 
 *  url: logo的连接
 **/
createQrCodeAndLogo({
    data:JSON.stringify({
        name:'showzhou',
        age:20,
        address:{
            country:'China',
            city:'Heilongjiang',
            detailed:'No. 99-1, Shimao Avenue, Songbei District, Harbin City, Heilongjiang Province'
        }
    }),
    url:''
});
  • 读取二维码
// data:data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAE...
readQRCode({
    data
});
  • 创建不带logo的二维码
/** 
 *  data: 存入数据 
 **/
createQrCode({
    data:JSON.stringify({
        name:'showzhou',
        age:20,
        address:{
            country:'China',
            city:'Heilongjiang',
            detailed:'No. 99-1, Shimao Avenue, Songbei District, Harbin City, Heilongjiang Province'
        }
    })
});
  • 返回图片base64数据
/**
 * url: https://... 
 **/
imgToBase64(url);

// return `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAE...`
  • 指定二维码图片大小
/**
 * data: 原始数据; 默认:200x200
 * width: 宽
 * height: 高 
*/
createQrcodeSizeControl({
    data:JSON.stringify({name:'压根哈哈哈哈哈'}),
    width:600,
    height:600
})
// return `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAE...`
  • 降低图片质量()
/**
 * data?: 传入base64图片数据
 * url?: https://...
 * num: 降低的质量(0-100)
*/
updateImageQuality({
    url:'https://...',
    num:20
})
// return `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAE...`
  • 生成带logo的二维码图片压缩包(zip)
/**
 *  dataArray: 需要生成图片的数组
 *  url: logo连接 
 */

createQrCodeByZip({
    dataArray:[
        {
            fileName:'文件1',
            data:"这是我二维码内容1,AAAAAAAAAAAAAA"
        },
        {
            fileName: '文件2',
            data: "这是我二维码内容2,BBBBBBBBBBBBB"
        },
        {
            fileName: '文件3',
            data: "这是我二维码内容3,CCCCCCCCCCCCCC"
        },
        {
            fileName: '文件4',
            data: "这是我二维码内容4,DDDDDDDDDDDDDD"
        },
    ],
    url:''
});

// return `data:application/zip;base64,UEsDBAoAAAAAAFUNeVIAAAAAAAA......`
// 直接将返回值写入浏览器url输入框即可下载