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

fromcsv

v0.2.0

Published

[![NPM version](https://badge.fury.io/js/fromcsv.svg)](http://badge.fury.io/js/fromcsv) [![Build Status](https://travis-ci.org/One-com/fromcsv.svg?branch=master)](https://travis-ci.org/One-com/fromcsv)

Readme

FromCsv

NPM version Build Status

This module implements an engine for CSV importing.

Compared to other such importers, this lirary is intended to be far more versataile particularly when it comes to situations encountered by users with the matching of CSV data using a hash.

Common user cases

Missing values

Rows with empty data are competely excluded from the upload. If there are no values within a columns that would otherwise be unmatched then that column is ignored.

Missing columns

Missing columns are not considered a reason to abort processing the file.

Reordered columns

Columns can be uploaded in any order.

Unmatched columns

Columns without a match are recorded and be default a file cannot be uploaded with partial matches. Instead a data structure is returned which the caller must validate.

Usage

The engine is ready for use by creating an instance:

const FromCsv = require("fromcsv");

const importer = new FromCsv({
  dialects: {
    some_format: {
      columpMap: {
        "First Column": null,
        "Second Column": null
      }
    }
  }
});

This creates an instance of the importer that can be used to match CSV files of the "some_format" of CSV files. The same instance can be reused for each attempt to process files with the same columns.

fromStream

A text stream containing CSV data can be processed by passing it directly to the fromStream method:

const fs = require("fs");

const inputStream = fs.createReadStream("/path/to/file.csv");

importer.fromStream(inputStream, (err, output) => {
  // ...
});

fromData

To submit an unsuccessful payload to the server to be processed again, the fromData method is used:

const data = {
  header: ["Title", "Surname"],
  rows: [["Mr.", "Smith"], ["Mrs.", "Smith"]]
};

importer.fromData(data, (err, output) => {
  // ...
});