This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/server/loader.js

13 lines
377 B
JavaScript
Raw Normal View History

2020-11-10 14:41:56 -08:00
const fs = require('fs');
import Suml from 'suml';
import Papa from 'papaparse';
export const loadSuml = name => new Suml().parse(fs.readFileSync(`./data/${name}.suml`).toString());
export const loadTsv = name => Papa.parse(fs.readFileSync(`./data/${name}.tsv`).toString(), {
dynamicTyping: true,
header: true,
skipEmptyLines: true,
delimiter: '\t',
}).data;