0.0.9 • Published 3 years ago

use-csv v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

useCsv

React Hook adaptor of csvjson-csv2json

install

yarn add use-csv
# or
npm install use-csv

usage

import { useCsv } from "use-csv";
function App() {
  const {
    convertCsv,
    result: { status, json, message },
  } = useCsv();
  useEffect(() => {
    if (status !== "completed") return;
    /** handle the javascript object */
    console.log(json);
  }, [status]);

  return (
    <input
      type="file"
      onChange={(e) => convertCsv(e.target.files[0])}
      accept=".csv"
    />
  );
}
0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago