txt-file-to-json
Advanced tools
Comparing version 3.0.4 to 3.0.5
{ | ||
"name": "txt-file-to-json", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "Reads a txt file having a table and returns an array of obects. In which each object consists of all headers as keys and there data as values.", | ||
@@ -5,0 +5,0 @@ "main": "txt_to_json.js", |
@@ -1,5 +0,5 @@ | ||
<img src="./resources/txt_to_json.png" align="right" width="200" height="150"/> | ||
<p align="center"> | ||
<img src="./resources/txt_to_json.png" width="300" height="200"/> | ||
</p> | ||
<h1 align="center">txt-file-to-json</h1> | ||
<div align="center"> | ||
@@ -24,3 +24,2 @@ | ||
Use `filePath` key to provide `TEXT data from file`. | ||
```javascript | ||
@@ -30,5 +29,5 @@ const txtToJson = require("txt-file-to-json"); | ||
``` | ||
<br> | ||
Use `data` key to provide `TEXT data from variable or directly`. | ||
```javascript | ||
@@ -38,5 +37,5 @@ const txtToJSON = require("txt-file-to-json"); | ||
``` | ||
<br> | ||
#### Sample input (txt data) : | ||
``` | ||
@@ -50,3 +49,2 @@ FIRST_NAME LAST_NAME NUMBER EMAIL ADDRESS | ||
#### Sample output (json data) : | ||
``` | ||
@@ -77,5 +75,5 @@ [ | ||
``` | ||
<br> | ||
Use `noOfRecords` key along with `filePath` or `data` key to get data of `specific number of rows`. | ||
```javascript | ||
@@ -85,5 +83,5 @@ const txtToJson = require("txt-file-to-json"); | ||
``` | ||
<br> | ||
#### Sample output when `noOfRecords` is `1` (json data) : | ||
``` | ||
@@ -100,5 +98,6 @@ [ | ||
``` | ||
<br> | ||
# References | ||
* To convert text and csv both to json. Try - "https://www.npmjs.com/package/data-to-json" | ||
* To convert only csv data to json. Try - "https://www.npmjs.com/package/csv-file-to-json" | ||
* To convert text and csv both to json. Try - https://www.npmjs.com/package/data-to-json | ||
* To convert only csv data to json. Try - https://www.npmjs.com/package/csv-file-to-json |
85956
97