Skip to main content

@farmfe/plugin-dsv

🍣 A Farm plugin which converts .csv and .tsv files into JavaScript modules.

Requirements

This plugin requires an LTS Node version (v18.0.0+) and Farm v1.0.0+.

Installation

npm
yarn
pnpm
bun

Usage

Create a farm.config.js configuration file and import the plugin:

Practical Example

Suppose that you have a CSV (or TSV!) file which contains some information on delicious fruits:

And suppose you'd like to import that CSV as an Array within some part of your code. After adding the plugin (as shown above), you may import (or require) the CSV file directly. The import will provide an Array of Objects representing rows from the CSV file:

Extremely Fast Web Build Tool Written in Rust

Copyright © 2024 Farm Community. Built with Docusaurus.