chore: adding the README how to use
This commit is contained in:
parent
e45cdb29f5
commit
e4fdc5aec7
33
README.md
33
README.md
@ -1,4 +1,35 @@
|
||||
[](https://wakatime.com/badge/user/d9f2f680-1923-4275-ac1c-aa218aef47fb/project/7e6cb8a3-a2ab-4f20-82cb-2892b9e9f516)
|
||||
|
||||
# converter-csv-to-json
|
||||
convert csv file to json
|
||||
|
||||
convert csv file to json from a file in your system using nodejs
|
||||
|
||||
---
|
||||
## how to use
|
||||
|
||||
Install the package in the node project
|
||||
```bash
|
||||
npm i async-convert-csv-to-json
|
||||
touch index.js
|
||||
```
|
||||
|
||||
Add the next code in a nodejs file where the csv file is located
|
||||
|
||||
```js
|
||||
const path = require('path')
|
||||
const converter = require('async-convert-csv-to-json')
|
||||
const PATH = path.join(__dirname,)
|
||||
|
||||
const filePath = `${PATH}/name_of_your_file.csv`;
|
||||
|
||||
async function convert () {
|
||||
const jsonConverted = await converter(filePath)
|
||||
console.log(jsonConverted)
|
||||
}
|
||||
|
||||
convert()
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "async-convert-csv-to-json",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"description": "convert csv file to json",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user