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

luckyexcel-pj

v1.0.6

Published

An excel import and export library adapted to Luckysheet

Downloads

7

Readme

简体中文 | English

介绍

此版本为Luckyexcel的一个修改版本,主要修改内容为:

<script>
//原始的transformExcelToLuckyByUrl由回调方式修改成了Promise方式
import LuckyExcel from "luckyexcel-pj";

 LuckyExcel.transformExcelToLuckyByUrl("url","name")
 .then((data) => {
     //data格式: {files: exportJson, fs: luckysheetfile, binaryData: binaryData}
     //exportJson和luckysheetfile为原参数,binaryData为新增的参数url对应的二进制数据
 })
 .catch((e) => {
     //异常
 });
</script>

Luckyexcel,是一个适配 Luckysheet 的excel导入导出库,只支持.xlsx格式文件(不支持.xls)。

演示

Demo

特性

支持excel文件导入到Luckysheet适配列表

  • 单元格样式
  • 单元格边框
  • 单元格格式,如数字格式、日期、百分比等
  • 公式

计划

目标是支持所有Luckysheet支持的特性

  • 条件格式
  • 数据透视表
  • 图表
  • 排序
  • 筛选
  • 批注
  • excel导出

用法

CDN

<script src="https://cdn.jsdelivr.net/npm/luckyexcel/dist/luckyexcel.umd.js"></script>
<script>
    // 先确保获取到了xlsx文件file,再使用全局方法window.LuckyExcel转化
    LuckyExcel.transformExcelToLucky(file, function(exportJson, luckysheetfile){
        
        // 获得转化后的表格数据后,使用luckysheet初始化,或者更新已有的luckysheet工作簿
        // 注:luckysheet需要引入依赖包和初始化表格容器才可以使用
        luckysheet.create({
            container: 'luckysheet', // luckysheet is the container id
            data:exportJson.sheets,
            title:exportJson.info.name,
            userInfo:exportJson.info.name.creator
        });
    });
</script>

案例 Demo index.html展示了详细的用法

ES 和 Node.js

安装

npm install luckyexcel

ES导入

import LuckyExcel from 'luckyexcel'

// 得到xlsx文件后
LuckyExcel.transformExcelToLucky(file, function(exportJson, luckysheetfile){
    // 转换后获取工作表数据
});

案例 luckysheet-vue

Node.js导入

var fs = require("fs");
var LuckyExcel = require('luckyexcel');

// 读取一个xlsx文件
fs.readFile("House cleaning checklist.xlsx", function(err, data) {
    if (err) throw err;

    LuckyExcel.transformExcelToLucky(data, function(exportJson, luckysheetfile){
        // 转换后获取工作表数据
    });

});

案例 Luckyexcel-node

开发

环境

Node.js Version >= 6

安装

npm install -g gulp-cli
npm install

开发

npm run dev

打包

npm run build

项目中使用了第三方插件:JSZip,感谢!

交流

  • 任何疑问或者建议,欢迎提交Issues

  • 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群

  • 加入Luckysheet开发者交流QQ群

贡献者和感谢

版权信息

MIT

Copyright (c) 2020-present, mengshukeji