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

puan-word

v1.4.5

Published

``` // 引入 import PuanWord from 'puan-word'

Downloads

89

Readme

安装:

(c)npm i puan-word -S

使用说明

// 引入
import PuanWord from 'puan-word'

// 调用
PuanWord(templateUrl, data, options)

参数说明

templateUrl:导出模板地址
data:导出数据源
options:导出配置项

options导出配置项说明

| 配置项 | 字段 | 数据类型 | 默认值 | 说明 | | ----- | ---- | ---- | ---- | ---- | | 文件名称 | filename | String | - | 可支持变量渲染如:{address} | | 压缩包名称 | zipname | String | - | 仅在data(数据源)为数组时生效 | | 默认图片尺寸 | size | Array | [160, 160] | 未配置自适应图片的默认尺寸 | | 是否开启图片尺寸自适应 | autoSize | Boolean | true | - | | 图片尺寸自适应配置 | sizeOptions | Array | - | 仅在autoSiz为true时生效 | | 公共数据 | extendsData | Object | - | 在数据处理阶段会将公共数据内容与数据源合并,可用于多文件导出的相同数据混入 | | 图片尾缀 | suffix | String | !nw-600 | - | | 错误excel | errorExcel | Object | - | 可配置错误数据excel导出内容 | | 调试模式 | debug | Boolean | false | 可以查看调试信息 |

sizeOptions格式

sizeOptions: [
    {
        width: 80,
        keys: ['qrcode'] => qrcode字段图片将按照宽度80px,高度自适应渲染
    }
]

errorExcel格式

errorExcel: {
    header: [
        {title: "场所id", key: "id"},
        {title: "场所名称", key: "name"},
        {title: "所属社区", key: "grid_text"},
        {title: "场所地址", key: "address"},
    ]
}

常用渲染语法

注意:以下示例中a为举例变量名,实际使用中请根据真实变量名进行替换
{a} => 文本内容渲染
{-w:p a}{/a} => 循环渲染
{#a}{/a} => 1. 当a为数组时循环渲染,常用于表格(常用) 2.当a为boolean时可用于渲染判断(少用)
%a => 图片渲染