txt-file-to-json
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "txt-file-to-json", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"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.", | ||
@@ -31,2 +31,2 @@ "main": "txt_to_json.js", | ||
"homepage": "https://github.com/vprince001/txt_to_json#readme" | ||
} | ||
} |
@@ -12,14 +12,8 @@ <h1 align="center">txtToJson</h1> | ||
```sh | ||
yarn add txt_to_json | ||
npm i --save txt-file-to-json | ||
``` | ||
or | ||
```sh | ||
npm i --save txt_to_json | ||
``` | ||
## Usage | ||
`txt_to_json` support CommonJS. | ||
`txt-file-to-json` support CommonJS. | ||
@@ -29,4 +23,57 @@ ### In module system | ||
```javascript | ||
const txt_to_json = require("txt_to_json"); | ||
const dataInJSON = txt_to_json("./filePath.txt"); | ||
const txtToJson = require("txt-file-to-json"); | ||
const dataInJSON = txtToJson("./filePath.txt"); | ||
``` | ||
#### Sample txt file data : | ||
``` | ||
FIRST_NAME LAST_NAME NUMBER EMAIL ADDRESS | ||
Debra Burks 880012XXXX debra.burks@yahoo.com 9273 Thome Ave., Orchard Park, NY - 14127 | ||
Kasha Todd NULL kasha.todd@yahoo.com 910, Vine Street, Campbell, CA - 95008 | ||
Tameka Fisher 880111XXXX tameka.fisher@yahoo.com 7693 Honey Creek St., Redondo Beach, CA - 90278 | ||
Daryl Spence 990015XXXX NULL 988 Pearl Lane!!! (Uniondale), NY - 11553 | ||
Charolette Rice 720012XXXX charolette.rice@msn.com 107 ~ River Dr. `Sacramento`, "CA" 95820 | ||
``` | ||
#### Sample json data : | ||
``` | ||
[ | ||
{ | ||
FIRST_NAME: 'Debra', | ||
LAST_NAME: 'Burks', | ||
NUMBER: '880012XXXX', | ||
EMAIL: 'debra.burks@yahoo.com', | ||
ADDRESS: '9273 Thome Ave., Orchard Park, NY - 14127' | ||
}, | ||
{ | ||
FIRST_NAME: 'Kasha', | ||
LAST_NAME: 'Todd', | ||
NUMBER: 'NULL', | ||
EMAIL: 'kasha.todd@yahoo.com', | ||
ADDRESS: '910, Vine Street, Campbell, CA - 95008' | ||
}, | ||
{ | ||
FIRST_NAME: 'Tameka', | ||
LAST_NAME: 'Fisher', | ||
NUMBER: '880111XXXX', | ||
EMAIL: 'tameka.fisher@yahoo.com', | ||
ADDRESS: '7693 Honey Creek St., Redondo Beach, CA - 90278' | ||
}, | ||
{ | ||
FIRST_NAME: 'Daryl', | ||
LAST_NAME: 'Spence', | ||
NUMBER: '990015XXXX', | ||
EMAIL: 'NULL', | ||
ADDRESS: '988 Pearl Lane!!! (Uniondale), NY - 11553' | ||
}, | ||
{ | ||
FIRST_NAME: 'Charolette', | ||
LAST_NAME: 'Rice', | ||
NUMBER: '720012XXXX', | ||
EMAIL: 'charolette.rice@msn.com', | ||
ADDRESS: '107 ~ River Dr. `Sacramento`, "CA" 95820' | ||
} | ||
] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4939
4
78