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

cliptabular

v1.3.0

Published

Parse and stringify clipboard data from Excel, CSV, and other delimited formats. Handles tabs, commas, quotes, currency, percentages, and negative numbers.

Downloads

118

Readme

cliptabular 📋↔️📊

Parse and stringify clipboard data from Excel, CSV, and other delimited formats. Handles tabs, commas, quotes, currency, percentages, and negative numbers.

actions version downloads Install Size License


Features

  • Smart delimiter detection (tabs, commas, semicolons, pipes, spaces)
  • Automatically prefers Excel’s tab-delimited format
  • Ignores delimiters inside quotes
  • Handles quoted fields, escaped quotes, and messy numeric values
  • Supports currency, grouping, negatives, and percentages
  • Handles empty cells and empty rows cleanly
  • Bidirectional: parse → arrays, stringify → clipboard text
  • Zero dependencies

Install

npm install cliptabular
# or
pnpm add cliptabular

Usage

Parsing

import { parse } from "cliptabular";

const text = await navigator.clipboard.readText();
const rows = parse(text);

Examples

// Excel (tab-delimited)
parse("Name\tAge\nJohn\t30");
// => [["Name","Age"],["John","30"]]
// CSV with quoted commas
parse('"Smith, John","New York, NY"');
// => [["Smith, John", "New York, NY"]]
// Numeric + currency — comma stays inside the value
parse("Item,Price\nWidget,$1,234.56");
// => [["Item","Price"],["Widget","$1,234.56"]]
// Empty cells become null by default
parse("A,,C");
// => [["A", null, "C"]]

Stringifying

import { stringify } from "cliptabular";

const data = [
  ["Name", "Age"],
  ["John", "30"],
];

const text = stringify(data);
// "Name\tAge\nJohn\t30"

await navigator.clipboard.writeText(text);

Example

// Tab-delimited by default (Excel-friendly)
stringify([
  ["A", "B"],
  ["C", "D"],
]);
// => "A\tB\nC\tD"

Delimiter Detection

parse analyzes the first lines of text:

  • Tabs (Excel) take priority
  • Commas, semicolons, pipes, and spaces detected heuristically
  • Delimiters inside quotes are ignored
  • Header-shaped rows improve accuracy
  • Safe fallback to comma

Return Type

parse("A,,B");
// => (string | null)[][]

parse("A,,B", { emptyValue: "" });
// => string[][]

parse("A,,B", { emptyValue: "EMPTY" });
// => (string | "EMPTY")[][]

Parse Options

emptyValue

Value used when a cell is empty. Default: null

parse("A,,C", { emptyValue: "N/A" });
// => [["A", "N/A", "C"]]

padRows

Pads rows to equal width using emptyValue. Default: false

parse("A,B\nC", { padRows: true });
// => [["A","B"],["C",null]]

skipEmptyRows

Drops fully empty rows. Default: false

parse("A,B\n\nC,D", { skipEmptyRows: true });
// => [["A","B"],["C","D"]]

skipEmptyCells

Removes empty cells within rows (after trimming). Takes precedence over padRows. Default: false

parse("A,,C\n,B,", { skipEmptyCells: true });
// => [["A","C"],["B"]]

trim

Trims whitespace inside each cell. Default: true

parse("  A  ,  B  ");
// => [["A","B"]]

Stringify Options

delimiter

Default: \t

stringify([["A", "B"]], { delimiter: "," });
// => "A,B"

alwaysQuote

Quote every cell. Default: false

stringify([["A", "B"]], { delimiter: ",", alwaysQuote: true });
// => "\"A\",\"B\""

lineEnding

Default: \n

stringify([["A"], ["B"]], { lineEnding: "\r\n" });
// => "A\r\nB"

emptyValue

Value considered “empty” in your data. Default: null

stringify([["A", null, "C"]], { delimiter: "," });
// => "A,,C"

emptyOutput

String to output for empty cells. Default: ""

stringify([["A", null, "C"]], {
  delimiter: ",",
  emptyValue: null,
  emptyOutput: "N/A",
});
// => "A,N/A,C"