@rs-pk/csvto-json
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

CSVtoJSONLibrary

This project was generated with Angular CLI version 10.0.5.

CSV Format => JSON Format

Demo Link

Stackblitz Demo

Step - 1

npm i ngx-csvto-json --save
NPM Package Link

import NgxCSVtoJSONModule in app.module.ts file.
app.module.ts

import {NgxCSVtoJSONModule} from 'ngx-csvto-json';
 imports: [
    NgxCSVtoJSONModule
  ]

Step - 2

Use selector "Ngx-CSVtoJSON" to use the converter component
Note: This component can emit two events "onConvert" and "onFail"
Bind those event in app.component.ts file with user defined functions and process the result
app.component.ts

convert(objArray){
  console.log(objArray);
 }
 onError(err){
   console.log(err);
 }

app.component.html

<Ngx-CSVtoJSON (onConvert)="convert($event)" (onFail)="onError($event)"></Ngx-CSVtoJSON>

CONVERTED RESULT FORMAT

Result format will be in

finalobj= {
 properties: [],
 result: []
};

That's it you are good to go. Happy Coding :)

Package Sidebar

Install

npm i @rs-pk/csvto-json

Weekly Downloads

13

Version

1.0.0

License

MIT

Unpacked Size

134 kB

Total Files

26

Last publish

Collaborators

  • nqvietdev
  • quocanh99
  • tungnguyen1706
  • nguyenduytu
  • lnkhanh