@carlosnunezmx/csv_bun_plugin
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

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";

Readme

Keywords

none

Package Sidebar

Install

npm i @carlosnunezmx/csv_bun_plugin

Weekly Downloads

8

Version

0.5.1

License

none

Unpacked Size

230 kB

Total Files

7

Last publish

Collaborators

  • carlosnunezmx