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

csvhelper

v1.0.5

Published

This is command line interface tool to perform some conversion operation given in a config file on any given csv file and will write the converted csv file to the given output location

Readme

CSVHelper

A simple CSV Convertor, Ever

This is command line interface tool to perform some conversion operation given in a config file on any given csv file and will write the converted csv file to the given output location

Features

  • Formate date column by cofigured formate using moment package.
  • Filtering data by configurable dynamic predicate.
  • Create new column by aggregating existing column together in the configured order.
  • Create a new column value based on a predicate expression evalauted from existing column values.

Tech

CSVHelper uses a number of open source projects to work properly:

  • [create-file] - file system operations!
  • [csv-parser] - parsing input csv files
  • [csvtojson] - convert csv to json to perform transformation easily
  • [json-2-csv] - convert json back to csv
  • [moment] - perform manipulation on date values
  • [yargs] - configure command args for this cli tool

And of course CSVHelper itself is open source with a public repository on GitHub.

Installation

CSVHelper requires Node.js v10+ to run.

Install

npm install -g csvhelper

Usage from any where in the cmd execute below commands with mentioned args

csvhelper -s <sourceCSVpath> -c <configJSONfilePath> -o <outputFilePath>

Config JSON options

below is the total JSON config options, based on the operations concerned options should be provided to perform the transformation

{
    "operation": "",  
    // allowed operation values
    // formatter , filter, merge, formulaField
    "predicateOptions": {
        "columnName" : "mention column name base on which predicate should perform",
        "value": "threshold value",
        "operator": "operator for comparison"
    },
    // predicateOptions is required when the operation is filter
    "formateOptions": {
        "columnName": "column name on which formating should happen currently supports date column type",
        "formate" : "formate option ex MMM d, YYYY"
    },
    // formateOptions is required when the operation is formatter
    "mergeOptions": {
        "newColumnName": "new column name",
        "mergeColumns": ["array of column names in string"], ex ["col1", "col2"]
        "formate": "string inpeterpolation order based on which columns should be merged ex: ${0}, ${1} will give col1, col2"
    }
    // mergeOptions is required when the operation is merge
    "formulaFieldOptions" : {
        "columnName": "new column name",
        "predicate": {
            "field":"field on which predicate should be performed",
            "value": "threshold value",
            "operator": "comparison operator",
            "truthyValue":"what value should be added to column if predicate is true",
            "falsyValue": "what value should be added to column if predicate is fals"
        }
    }
    //formulaFieldOptions is required when the operation is formulaField
}

sample configs

for formatter operation

{
    "operation" : "formatter",
    "formateOptions" : {
        "columnName" : "dob",
        "formate": "MMM d, YYYY"
    }
}

filter operation config

{
    "operation" : "filter",
    "predicateOptions" : [{
        "columnName": "age",
        "value": "50",
        "operator": ">"
        
    }]
}

Merge operation config

{
    "operation" : "merge",
    "mergeOptions": {
        "newColumnName": "name",
        "mergeColumns": ["first_name","last_name"],
        "formate": "${0}, ${1}"
    }
}

Formula field config

{
    "operation" : "formulaField",
    "formulaFieldOptions": {
        "columnName": "eligible_for_voting",
        "predicate": {
            "field":"age",
            "value": "18",
            "operator": ">",
            "truthyValue":"T",
            "falsyValue": "F"
        }
    }
}

License

MIT

Free Software, Hell Yeah!