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

@univer-community/sheets-csv-import-export

v0.22.0

Published

A plugin for importing and exporting CSV files in Univer Sheets.

Downloads

93

Readme

@univer-community/sheets-csv-import-export

A plugin for importing and exporting CSV files in Univer Sheets.

  • Extends FUniver, FWorksheet, and FRange
  • UTF-8 default with explicit charset support on import
  • Export returns FBlob for callers to download or transform themselves

Installation

pnpm add @univer-community/sheets-csv-import-export

Usage

Register the logic plugin

import { UniverSheetsCsvImportExportPlugin } from "@univer-community/sheets-csv-import-export";

univer.registerPlugin(UniverSheetsCsvImportExportPlugin);

Create the facade API:

import { FUniver } from "@univerjs/core/facade";

const univerAPI = FUniver.newAPI(univer);

Facade API Methods

FUniver

await univerAPI.importCsv(file, {
  mode: "replace-sheet",
  charset: "utf-8",
});

const blob = univerAPI.exportCsv({
  includeBom: true,
  lineBreak: "\r\n",
});

FWorksheet

const sheet = univerAPI.getActiveWorkbook().getActiveSheet();

await sheet.importCsv("name,city\nalice,shanghai", {
  mode: "new-sheet",
  newSheetName: "Imported CSV",
});

const blob = sheet.exportCsv({
  delimiter: ",",
  includeBom: true,
});

FRange

const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange("B2:D10");

await range.importCsv(file, {
  mode: "replace-range",
});

const blob = range.exportCsv();

Download the returned FBlob yourself

const blob = sheet.exportCsv({ fileName: "report.csv", includeBom: true });
const nativeBlob = new Blob([await blob.getBytes()], {
  type: "text/csv;charset=utf-8",
});

const url = URL.createObjectURL(nativeBlob);
const link = document.createElement("a");
link.href = url;
link.download = "report.csv";
link.click();
URL.revokeObjectURL(url);

API Notes

  • importCsv accepts string | Blob | File | FBlob
  • Import modes:
    • replace-sheet: overwrite from A1
    • replace-range: overwrite from the target range's top-left cell
    • new-sheet: create a new worksheet before writing
  • exportCsv supports delimiter, lineBreak, and includeBom
  • There is no built-in menu mounting or default UI flow in this package

Local Development

Install dependencies:

pnpm install

Run lint:

pnpm lint

Run tests:

pnpm test

Run type checking:

pnpm typecheck

Build the library:

pnpm build

Build the demo:

pnpm build:demo

Start the demo:

pnpm dev

Build Output

Running pnpm build generates:

  • lib/es: ESM output
  • lib/cjs: CommonJS output
  • lib/types: TypeScript declaration files

Demo

The demo/ directory shows a complete CSV import/export flow:

  • Initialize a Univer instance with the required Sheets and UI plugins
  • Register UniverSheetsCsvImportExportPlugin
  • Use the facade API to import CSV content into a new sheet
  • Export sheet data as an FBlob and trigger a browser download

License

MIT