csv-parse-v
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i csv-parse-v

Weekly Downloads

2

Version

0.0.4

License

MIT

Unpacked Size

7.01 kB

Total Files

5

Last publish

Collaborators

  • shinshin86