0.5.1 • Published 1 year ago

@carlosnunezmx/csv_bun_plugin v0.5.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

CSV Loader Plugin for Bun

Created with @fast-csv/parse

Usage

Installation

bun install @carlosnunezmx/csv_loader_bun

Use as plugin in runtime

In your preload file you need to plug-in

import csv_config from "@carlosnunezmx/csv_loader_bun";
import { plugin } from "bun";

// Mount your plugins :D
plugin(csv_config({
  // Your config
}))

Then you need to import it into your bunfig.toml

preload = ["plugins.ts"]

Now you can import your csv as a normal module.

import {data} from "mydata.csv"
console.log(data);

Get types

To get types to your modules you need to import this file to your global.d.ts file

// global.d.ts
import "@carlosnunezmx/csv_loader_bun/types";
0.5.1

1 year ago

0.5.0

1 year ago

0.0.1

1 year ago