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 🙏

© 2025 – Pkg Stats / Ryan Hefner

funky-csv

v0.1.2

Published

Write CSV files without losing your coding rhythm

Downloads

42

Readme

Funky CSV

Make & Read CSV files without loosing your coding rhythm

Installation

$ npm i funky-csv

Create CSV Files

Backend

const FunkyCSV = require('funky-csv/node');

const csv = new FunkyCSV;

csv.setHeader([
    'Column Title 1',
    'Column Title 2',
]);

csv.setContent([
    {
        val1: 'Value column 1 row 1',
        val2: 'Value column 2 row 1',
    },
    {
        val1: 'Value column 1 row 2',
        val2: 'Value column 2 row 2',
    },
]);

csv.write().then(() => console.log('output.csv successfully created!'));

Frontend

import FunkyCSV from 'funky-csv/browser';

const csv = new FunkyCSV;

csv.setHeader(...);
csv.setContent(...);

csv.download().then(() => console.log('output.csv successfully downloaded!'));

Read and parse CSV files

Backend

import FunkyCSVReader from 'funky-csv/node-reader';

const csv = new FunkyCSVReader;
csv.read('path/to/filename.csv').then(console.log) // [{col1: field1, col2: field2}]

Frontend

import FunkyCSVReader from 'funky-csv/browser-reader';

const csv = new FunkyCSVReader;
const csvString = '"col name 1","field1"\n"col name 2","field2"\n'
csv.parse(csvString).then(console.log) // [{colName1: field1, colName2: field2}]

🪄 Column names are automatically converted to camelCase style

Custom options

Example:

const csv = new FunkyCSV({
    filename: 'custom_filename.csv',
    delimiter: ';',
    closure: '"',
    ...
});

| Option | Type | Default | Writer | Reader | Description | |--------------------------|-----------|-------------|:----------:|:---------:|---------------------------------------------| | filename | string | output.csv | ✅ | ❌ | Output file name | | delimiter | string | , | ✅ | ✅ | Column delimiter | | closure | string | " | ✅ | ✅ | Closure character for string delimiter | | headerRow (*) | number | 0 | ❌ | ✅ | Row number of header location (where to start reading) | | newLine | string | \n | ❌ | ✅ | New line ascii character | | parseNumbers | boolean | false | ❌ | ✅ | Parse string numbers to number type |

Custom Header on file reading

Setting headerRow as -1 the parser returns an array of arrays representing each row without header instead of an array of objects with key-value pair. Example:

// If we don't specify headerRow
[
  ['field1', 'field2'], // row 0
  ['field3', 'field4'], // row 1
  ...                   // next rows...
]

As an alternative we can set your own custom header. Example:

const csvReader = new FunkyCSVReader;
csvReader.setHeader([
  'column title 1',
  'column title 2',
  ...
])
csvReader.read('filename.csv').then(console.log) // [{columnName1: 'field1', columnName2: 'field2'}]

Extras

Setting filename on write & download method

// nodejs
csv.write('custom_filename');

// browser
csv.download('custom_filename');

🪄 You can omit .csv extension, Funky CSV will automatically add it.