0.0.4 • Published 2 years ago

csv-parse-v v0.0.4

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

csv-parse-v

Test

logo

ES Modules style CSV Parser

Install

# npm
npm i csv-parse-v

# yarn
yarn add csv-parse-v

# pnpm
pnpm add csv-parse-v

Usage

import parse from 'csv-parse-v';

const csv = `id,title,text,createdAt,updatedAt
1,foo,bar,2022-01-01T00:00:00.000Z,2022-01-02T23:59:59.123Z
2,foo2,bar2💨,2022-02-01T00:00:00.000Z,2022-02-02T23:59:59.123Z`;

const result = parse(csv);
console.log(result);

For use within HTML (use esm sample).

<html>
  <head>
    <meta charset="UTF-8">
    <script type="module">
      // Use esm.sh
      import parse from 'https://esm.sh/csv-parse-v';

      const csv = `id,title,text,createdAt,updatedAt
1,foo,bar,2022-01-01T00:00:00.000Z,2022-01-02T23:59:59.123Z
2,foo2,bar2💨,2022-02-01T00:00:00.000Z,2022-02-02T23:59:59.123Z`;

      const result = parse(csv);
      alert(JSON.stringify(result));
    </script>
  </head>
  <body>
  </body>
</html>

demo image

Development

Test

npm run test

Code format

Use deno fmt.

npm run fmt

License

MIT

Author

Yuki Shindo

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago