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

xlsx-gen-json

v1.1.3

Published

excel to json

Readme

xlsx-2-json

1.Excel文件配置规范

1.字段名*(key)*必须为英文字母

2.字段名*(key)*在第一行

3.第二行是字段描述,不做处理

4.辅助表格字段名字用中文,就不会生成在json

5.第一列必须为必填字段,必须有值*(如:Id)*,没有值不会生成在json里

6.遍历xlsx文件里的sheet,在output目录输出以sheet name为名字的json文件

7.生成Data Type 2,首列值连续一样的行会被认为是数组,注意如图字段描述最后要加上“[]”标记生成数组形式

2.脚本调用:

例:在build.js里

const xlsx2json = require("xlsx-gen-json");
xlsx2json.toJson("./excel/gameconfig.xlsx","./src/config/",function(e,r){
	e?console.log(e):console.log(r);
});

3.Sheet and Data

Data Type 1:

Sheet

javascript:

{
	"1":{"name":"superman","toyid":1,"price":100,"tag":[101,103,108]}
}

lua:

local toys =
{
	["1"] = 
	{
		["name"] = "superman",
		["toyid"] = 1,
		["price"] = 100,
		["tag"] = 
		{
			101,
			103,
			108
		}
	}
}
return toys

Data Type 2:

Sheet

javascript

{
	"1":[{"num":3,"id":1,"toyid":1},
		{"num":4,"id":1,"toyid":2},
		{"num":5,"id":1,"toyid":3}],
	"2":[{"num":1,"id":2,"toyid":4},
		{"num":4,"id":2,"toyid":1}]
}

lua:

local missions =
{
	["1"] = 
	{
		{
			["num"] = 3,
			["id"] = 1,
			["toyid"] = 1
		},
		{
			["num"] = 4,
			["id"] = 1,
			["toyid"] = 2
		},
		{
			["num"] = 5,
			["id"] = 1,
			["toyid"] = 3
		}
		},
	["2"] = 
	{
		{
			["num"] = 1,
			["id"] = 2,
			["toyid"] = 4
		},
		{
			["num"] = 4,
			["id"] = 2,
			["toyid"] = 1
		}
	}
}
return missions

4.更新

1.支持生成以id为Key的Map方式以提高访问效率,参数useDictionary 2.支持生成Lua配置

const xlsx2json = require("xlsx-gen-json");
xlsx2json.toJson("./excel/gameconfig.xlsx","./src/config/",function(e,r){
	xlsx2json.jsonToLua(r,"./src/config/lua/"+s+".lua");
},true);