This repository was archived by the owner on Apr 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -21,5 +21,30 @@ To import CSV, use the **fromFile** method
2121 * @param {Number|Number[]} [ignoreLines= 0 ] Ignore lines. Use 0 to use no-ignore lines
2222 * @returns {Object[]} CSV Object
2323 */
24- csv .fromFile ({file_path},ignoreLines= 0 );
24+ const myCSV = csv .fromFile ({file_path},ignoreLines= 0 );
25+ ```
26+ ### From String
27+ To use a string version of CSV to create an object us the ** fromString** method
28+ ``` js
29+ /**
30+ * Converts CSV from string to object
31+ * @param {String} str CSV string
32+ * @param {Number|Number[]} ignoreLines Lines to ignore
33+ * @returns {Object[]} CSV object
34+ */
35+ const myCSV = csv .fromString (str, ignoreLines= 0 );
36+ ```
37+
38+ ### Ignoring lines
39+ Use the ** _ ignoreLines_ ** parameter of either a ** Number** | ** Number[ ] ** . Numbers must be start from 1..., ** 0** means _ no-ignore_ or _ skip_
40+
41+ ### Tables
42+ To load up the table from an object, use the ** toTable** method
43+ ``` js
44+ /**
45+ * Creates a table off the object
46+ * @param {Object} obj Object of the CSV
47+ * @param {Element} elem Element to target the CSV
48+ */
49+ csv .toTable (myCSV, {element});
2550```
You can’t perform that action at this time.
0 commit comments