Skip to content

Commit 349262c

Browse files
committed
update readme
1 parent b252231 commit 349262c

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
11
# CSV to Matrix
22

3-
CVS to Matrix parser. Reads a CSV file, outputs a arrays in array (Matrix): `npm install csv-to-matrix`
3+
A simple CVS to Matrix parser - reads a CSV file, outputs an arrays in array (Matrix).
4+
5+
## Installation
6+
7+
`npm install csv-to-array-matrix`
8+
9+
## Usage
10+
11+
12+
```
13+
import csvToMatrix from 'csv-to-array-matrix';
14+
15+
csvToMatrix('./src/data.csv', callback);
16+
17+
function callback(data) {
18+
console.log(data);
19+
}
20+
```
21+
22+
Transforming into a [Matrix object with math.js](https://www.robinwieruch.de/linear-algebra-matrix-javascript/).
423

524
```
625
import math from 'mathjs';
7-
import csvToMatrix from 'csv-to-matrix';
26+
import csvToMatrix from 'csv-to-array-matrix';
827
9-
csvToMatrix(pathToFile, callback, delimiter);
28+
csvToMatrix(pathToFile, callback);
1029
1130
function callback(data) {
1231
const matrix = math.matrix(data);
1332
}
33+
```
34+
35+
The default delimiter is ';', but you use a different one.
36+
37+
```
38+
import csvToMatrix from 'csv-to-array-matrix';
39+
40+
csvToMatrix('./src/data.csv', callback, ',');
41+
42+
function callback(data) {
43+
console.log(data);
44+
}
1445
```

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "csv-to-matrix",
3-
"version": "1.0.0",
4-
"description": "A CVS to arrays in array (Matrix) parser.",
2+
"name": "csv-to-array-matrix",
3+
"version": "0.1.1",
4+
"description": "A simple CVS to arrays in array (Matrix) parser.",
55
"main": "lib/index.js",
66
"dependencies": {
77
"fast-csv": "^2.4.1"
@@ -17,13 +17,13 @@
1717
},
1818
"repository": {
1919
"type": "git",
20-
"url": "git+https://github.com/rwieruch/csv-to-matrix.git"
20+
"url": "git+https://github.com/rwieruch/csv-to-array-matrix.git"
2121
},
2222
"keywords": [],
2323
"author": "“Robin <“wrobin@gmx.net”> (https://www.robinwieruch.de)",
2424
"license": "MIT",
2525
"bugs": {
26-
"url": "https://github.com/rwieruch/csv-to-matrix/issues"
26+
"url": "https://github.com/rwieruch/csv-to-array-matrix/issues"
2727
},
28-
"homepage": "https://github.com/rwieruch/csv-to-matrix#readme"
28+
"homepage": "https://github.com/rwieruch/csv-to-array-matrix#readme"
2929
}

0 commit comments

Comments
 (0)