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

excel-export-plugin

v1.0.6

Published

A plugin for exporting data to Excel files

Readme

excelExportPlugin

A lightweight and flexible plugin for exporting data to Excel files. It supports exporting data from arrays or Blob objects, with customizable headers and file names.

一个轻量级且灵活的插件,用于将数据导出为 Excel 文件。支持从数组或 Blob 对象导出数据,并支持自定义表头和文件名。


Features / 功能

  • Export from arrays or Blob objects: Easily export structured data or raw binary data.

  • Customizable headers: Define column headers for better control over the exported file format.

  • Lightweight and easy to use: Minimal dependencies and simple API.

  • File name customization: Specify the name of the exported Excel file.

  • Cross-browser support: Works in modern browsers.

  • 支持从数组或 Blob 对象导出:轻松导出结构化数据或原始二进制数据。

  • 支持自定义表头:定义列标题,便于控制导出的文件格式。

  • 轻量级,易于使用:依赖最少,API 简单。

  • 支持文件名自定义:可指定导出的 Excel 文件名。

  • 跨浏览器支持:适用于现代浏览器。


Installation / 安装

Install the plugin via npm:

通过 npm 安装插件:

npm install excel-export-plugin

Usage / 使用方法

Basic Example / 基本示例

import { exportExcel } from "excel-export-plugin";

const data = [
    { id: 1, name: "Alice", email: "[email protected]" },
    { id: 2, name: "Bob", email: "[email protected]" },
];

exportExcel({
    data,
    columns: [
        { key: "id", title: "User ID" },
        { key: "name", title: "User Name" },
        { key: "email", title: "Email Address" },
    ],
    fileName: "users.xlsx",
});

API Reference / API 参考

exportExcel(options)

Exports data to an Excel file.

将数据导出为 Excel 文件。

Parameters / 参数

  • options.data (Array | Blob)
    The data to be exported. Can be an array of objects or a Blob object.
    要导出的数据,可以是对象数组或 Blob 对象。

  • options.columns (Array)
    An array of column definitions. Each column should have a key (data field) and a title (header name).
    列定义数组。每列应包含 key(数据字段)和 title(表头名称)。

  • options.fileName (String)
    The name of the exported Excel file (e.g., data.xlsx).
    导出的 Excel 文件名(例如:data.xlsx)。

Example / 示例

exportExcel({
    data: [
        { id: 1, name: "Alice", email: "[email protected]" },
        { id: 2, name: "Bob", email: "[email protected]" },
    ],
    columns: [
        { key: "id", title: "User ID" },
        { key: "name", title: "User Name" },
        { key: "email", title: "Email Address" },
    ],
    fileName: "users.xlsx",
});

Use Cases / 使用场景

  • Exporting user data from a web application.
    从 Web 应用导出用户数据。
  • Generating reports in Excel format.
    生成 Excel 格式的报告。
  • Saving raw data for offline analysis.
    保存原始数据以供离线分析。

License / 许可证

MIT License. See LICENSE for details.

MIT 许可证。详情请参阅 LICENSE