🎯
Focusing
Pinned Loading
-
This code helps convert a .csv file ...
This code helps convert a .csv file (containing a single column) into an array stored in a .ts file. It reads data from a file named 'data.csv' and creates a new TypeScript file 'csvData.ts' containing the data in an array named 'csvData'. The input file's name can be changed from line #4 and the array's name can be changed from line #17. To get data in a JavaScript file, simply modify the extension of the output file's name in line #20 from .ts to .js. Possible Error -> All the array values have a comma at the end. Solution -> Modify the delimitator from '\n' to ',' in line #11. 1const fs = require('fs');
23// Read the csv data
4fs.readFile('data.csv', 'utf-8', (error, csvData) => {
5if (error) {
-
-
ts-error-translator
ts-error-translator PublicForked from mattpocock/ts-error-translator
VSCode extension to turn TypeScript errors into plain English
TypeScript
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.