csv-parse-v
v0.0.4
Published
ES Modules style CSV Parser
Downloads
3
Maintainers
Readme
csv-parse-v
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>
Development
Test
npm run test
Code format
Use deno fmt
.
npm run fmt
License
MIT