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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@runnerty/executor-csv2json

v3.0.2

Published

Runnerty module: CSV2JSON executor

Downloads

3

Readme

NPM version Downloads Dependency Status

Executor for Runnerty: CSV2JSON

Installation:

Through NPM

npm i @runnerty/executor-csv2json

You can also add modules to your project with runnerty-cli

npx runnerty-cli add @runnerty/executor-csv2json

This command installs the module in your project, adds example configuration in your config.json and creates an example plan of use.

If you have installed runnerty-cli globally you can include the module with this command:

rty add @runnerty/executor-csv2json

Configuration sample:

Add in config.json:

{
  "id": "csv2json_default",
  "type": "@runnerty-executor-csv2json"
}

Plan sample:

Add in plan.json:

Example 1:

{
  "id": "csv2json_default",
  "inputPath": "test.csv",
  "outputPath": "test.json",
  "options": {
    "headers": true,
    "delimiter": ";",
    "escape": "\""
  }
}

Example 2:

{
  "id": "csv2json_default",
  "inputPath": "test.csv",
  "options": {
    "headers": ["id_renamed", null, "email"],
    "renameHeaders": true,
    "discardUnmappedColumns": true,
    "delimiter": "|"
  }
}

Params

Options

| Option | Description | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | delimiter | The delimiter that will separate columns. Default: ',' | | quote | The character to use to quote fields that contain a delimiter. Default: '"' | | escape | The character to used tp escape quotes inside of a quoted field. Default: '"' | | headers | If set to true the first row will be treated as the headers. If you want to manually specify the headers set to a string[]. Default: true | | renameHeaders | If you want the first line of the file to be removed and replaced by the one provided in the headers option. Default: false | | ignoreEmpty | Set to true to ignore empty rows. Default: false | | comment | If your CSV contains comments you can use this option to ignore lines that begin with the specified character. Default: null | | discardUnmappedColumns | If you want to discard columns that do not map to a header. Default: false | | strictColumnHandling | If you want to consider empty lines/lines with too few fields as invalid and emit a data-invalid event. Default: false | | trim | Set to true to trim all white space from columns. Default: false | | rtrim | Set to true to right trim all columns. Default: false | | ltrim | Set to true to left trim all columns. Default: false | | encoding | Passed to StringDecoder when decoding incoming buffers. Change if incoming content is not 'utf8' encoded. Default: 'utf8' | | maxRows | If number is > 0 then only the specified number of rows will be parsed. Default: 0 | | skipRows | If number is > 0 then the specified number of parsed rows will be skipped. Default: 0 | | skipLines | If number is > 0 the specified number of lines will be skipped. Default: 0 |

Output (Process values):

  • PROCESS_EXEC_MSG_OUTPUT: Output message.
  • PROCESS_EXEC_ERR_OUTPUT: Error output message.

Data output

  • PROCESS_EXEC_DATA_OUTPUT: JSON output data.
  • PROCESS_EXEC_DB_ROWCOUNT: Count rows.

More information:

This executor uses the fast-csv module, for more information consult the website of the csv2json.