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 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-print-tickertape

v0.0.1

Published

以html的方式生成打印凭条机器适用的图片

Downloads

2

Readme

js-print-tickertape

用前端的布局方式实现凭条布局,生成bmp图片交给打印机打印

1.使用

npm i js-print-tickertape
or
yarn add js-print-tickertape
//base64
let data = await generate(`
                                <div style="height: auto;width: 300px;padding:20px;display: flex;flex-direction:column;align-items: center;border: 1px #000 solid">
                                    <h1 style="display: inline-block">打印凭条测试</h1>
                                    <div style="display: flex;padding: 12px 20px;width: 100%;align-items: center">
                                        <div style="font-weight: bold;font-size: 16px;width: 120px;padding-right: 20px">名称:</div>
                                        <div style="">打印测试值</div>
                                    </div>
                                     <div style="display: flex;padding: 12px 20px;width: 100%;align-items: center">
                                        <div style="font-weight: bold;font-size: 16px;width: 120px;padding-right: 20px">名称:</div>
                                        <div style="">打印测试值</div>
                                    </div>
                                     <div style="display: flex;padding: 12px 20px;width: 100%;align-items: center">
                                        <div style="font-weight: bold;font-size: 16px;width: 120px;padding-right: 20px">名称:</div>
                                        <div style="">打印测试值</div>
                                    </div>
                                     <div style="display: flex;padding: 12px 20px;width: 100%;align-items: center">
                                        <div style="font-weight: bold;font-size: 16px;width: 120px;padding-right: 20px">名称:</div>
                                        <div style="">打印测试值</div>
                                    </div>
                                    <div>-----------------------------------------</div>
                                    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALkAAAC5CAAAAABRxsGAAAACHUlEQVR42u3aUY6DMAxFUfa/6c4GmuQ+R2ia+PI1FQwcKtVxbD+fU49HuXLlypUr/xX5sz6+3mF0CbjV8CMQKFfeUT7+KX85S23zW80vHv+bcuVd5XPCPI7MX2l4g0igXLlyIgfxhiTa8BnKlSvfii3zWw3f8AeionLlR8lBBIheLopLL+4slCs/Xh5til/568XqnHLlJ8txg2a9H6Yl6yiP3+9wKVd+spyWqGgYWKTXSWxRrlw52cTmwQSk6+Bpi/xcufKGcvr04Ufazo34ypW3ldOFGgxHgSgTtXOz+rly5VfKweRT/vQ8kcDBSbnyXvLtmSW6555/LOTnypW3kUf5ND2bb6i3qtDKlfeS59MU+cXDAIN70MqVN5SDhm2+oOf8wuqvXPltcrqxpbXnebigxetsGkq58nvl2/k5TbmjieLClIhy5ffKaY2rWAEDEYo2lZQr7yiPekJzW17tAieUK+8tz2cT8xZR3ifKoqJy5ffK6SpMK1vFoEOyfOXKlYOxxDwDzwaHo72/cuUd5DQ+FPe+9GmF2KJc+b1yPIaUZNHRKEfWgVKuvJc8mg/ON9k0auFvQrnyhvJoO5vPAhd7UdW9v3LlV8rp7x7MWkSjFzScKVeuPFuZ810wSBAKfSLlypVnlaj1IOP85baq0MqVXymf5+e0YpUnA1HbV7nyjvJoGS/Wj8FyD9q5ypU3kx92KFeuXLly5f97/AGmZM95vU+apAAAAABJRU5ErkJggg=="/>
                                    <h2 style="display: inline-block">关注二维码</h2>
                                    <div>-----------------------------------------</div>
                                </div>`
            );