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

execl2json

v0.0.1

Published

excel to json or zip

Downloads

3

Readme

测试命令

node dist/index test/source test/target test/target

介绍

工具支持excel、csv格式的文件导出成zip。 zip中的格式为json.

工具主要针对一些typescript项目,在导出zip的同时,导出相关类的定义文件。

支持number,string数组导出,具体看查看文件夹test


根据excel或csv源目录中包含的configlist.xlsx文件确定哪些文件需导出,哪些不需导出 configlist.xlsx 表头格式: 序号(number), 表文件名, 表介绍, 是否导出客户端(1|0), 是否导出服务端(1|0) 1, gift, "奖励", 1, 1

node dist/index sourcepath(表源) targetpath(表输出) interfacepath(接口输出)

实现原理,编译源文件夹的所有文件为 config.zip 与 Cfgs.ts 两个文件到指定目录,项目中都需要引用或加载。

注意:表中为空的字段不会被导出,需程序判定字段是否存在。

cfgs.ts包含类的定义描述如:

config.zip 解压 使用到jszi库

    //加载数据
    let zip = await jszip.loadAsync(data|config.zip);
    let text = await zip.file("allcfg.json").async("string");
    let jsonObj = JSON.parse(text);
    downzip.remove("allcfg.json");
    //读取数据
    let tableItem:Cfgs.Types.skill_data = jsonObj["skill_data"][1];
/** 机器码 cfgs.ts */
module Cfgs{ 
    export const skill_data:{name:string,clz:Types.skill_data} = {name:"skill_data",clz:null};
    export const spirits_data:{name:string,clz:Types.spirits_data} = {name:"spirits_data",clz:null};

    export declare namespace Types {
        export interface skill_data{
            /** #技能ID */ 
            id:number;
            /** 技能名 */ 
            SkillName_l:string;
            /** 技能图标 */ 
            SkillIcon:string;
            /** 技能描述 */ 
            SkillMark_l:string;
        }
        export interface spirits_data{
            /** #式神id */ 
            id:number;
            /** 式神名称 */ 
            Name_l:string;
            /** 式神介绍 */ 
            Remak_l:string;
            /** 式神形象id */ 
            SpiritsModelId:number;
        }
 
    }
}

@author yangxiao