![]() Approach: Follow the steps below to achieve the solution: Read the csv file using default fs npm package. ![]() You can use FileReader to read its content. All the rows of the CSV will be converted to JSON objects which will be added to the resultant array which will then be converted to JSON and a corresponding JSON output file will be generated. ![]() at 14:30 Add a comment 4 Answers Sorted by: 14 You are passing File to csvJSON method instead of file's text. csvtojson: Convert csv to JSON format version: 2.0.10 Usage: csvtojson filepath Commands: parse: (Default)Parse a csv file to json version: Show version of current csvtojson Options: -output: The format to be converted to. 'use strict' const http = require ( 'http' ) const fs = require ( 'fs' ) const express = require ( 'express' ) const multer = require ( 'multer' ) const csv = require ( 'fast-csv' ) const Router = express. Toby Jackson at 14:23 You should use FileReader.readAsText to read file and then send it to csvJSON method Aleksey L. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |