ndim-parser
v0.5.1
Published
File parser for n-dimensional values
Downloads
7
Readme
ndim-parser
File parser for n-dimensional values.
Installation
$ npm i ndim-parser
Usage
import { ndParse } from 'ndim-parser';
const simpleExample = `
meta.first,1
meta.second,,2
temp, volt, curr
1,1,1
2,2,2
3,3,3
`;
expect(ndParse(simpleExample, { separator: ',' })).toStrictEqual({
data: {
t: { data: [1, 2, 3], label: 'temp' },
v: { data: [1, 2, 3], label: 'volt' },
c: { data: [1, 2, 3], label: 'curr' },
},
meta: {
'meta.first': '1',
'meta.second': '2',
},
});