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

wy-docx-generate

v1.0.3

Published

word,docx,xlsx,根据表格或JSON数据,使用模板渲染word文档的脚手架工具

Downloads

18

Readme

wy-docx-generate功能简介:

使用命令行进行excel数据转换json,或者通过excel数据通过word模板最终生成word文档。

安装说明:

  1. 电脑安装 nodejs 建议安装 v16.18.1及以上版本。

  2. 全局安装:

    npm i wy-docx-generate -g

    使用说明:

  3. 把excel文件转换成JSON数据

    命令1: jsonbyxlsx

    wy-docx-generate jsonbyxlsx --input 输入文件名 --output 输出文件名 --sheetName excel的sheet名称

    例如:wy-docx-generate jsonbyxlsx --input input.xlsx --output array.json -s sheet1 使用input.xlsx的sheet1输出在当前目录生成一个 array.json文件

  4. 通过excel文件生成word文档

    命令2: createbyjson

wy-docx-generate createbyjson --template 模板文件名 --json json文件名 --output 输出文档文件名

例如:wy-docx-generate createbyjson --template template.docx --json array.json --output mydoc.docx

使用template.docx作为模板使用array.json作为数据源 生成mydoc.docx

命令3:createbyxlsx

wy-docx-generate createbyxlsx --template 模板文件名 --xlsx xlsx文件名 --sheetname excel的sheet名称 --output 输出文档文件名 --datakey datakey

例如:wy-docx-generate createbyxlsx --template template.docx --xlsx input.xlsx --sheetname sheet1 --output mydoc.docx --datakey array

模板.docx语法参考网址:

https://docxtemplater.com/docs/tag-types

https://docxtemplater.com/docs/angular-parse