select-csv 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +36 -27
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -58,6 +58,15 @@ parse = parseText(
58
58
  );
59
59
 
60
60
 
61
+ ```
62
+
63
+ * If you want to get just the header :
64
+ ```js
65
+ const result = parse.header();
66
+ /*
67
+ ["Index","User Id","First Name","Last Name","Sex"]
68
+ */
69
+
61
70
  ```
62
71
 
63
72
  * If you want to get all rows :
@@ -96,9 +105,9 @@ result = parse.chunk(c)
96
105
  result = parse.chunk(2) //Return row 0 and 1
97
106
  /*
98
107
  {
99
- "Time": 0,
100
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
101
- "Rows": [
108
+ time: '0 ms',
109
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
110
+ rows: [
102
111
  [ "1", "5f10e9D33fC5f2b", "Sara", "Mcguire", "Female" ],
103
112
  [ "2", "751cD1cbF77e005", "Alisha", "Hebert", "Male" ]
104
113
  ],
@@ -109,9 +118,9 @@ result = parse.chunk(2) //Return row 0 and 1
109
118
  result = parse.chunk(3) //Return row 2,3 and 4 (Get rows from last offset saved)
110
119
  /*
111
120
  {
112
- "Time": 0,
113
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
114
- "Rows": [
121
+ time: '0 ms',
122
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
123
+ rows: [
115
124
  [ "3", "DcEFDB2D2e62bF9", "Gwendolyn", "Sheppard", "Male" ],
116
125
  [ "4", "C88661E02EEDA9e", "Kristine", "Mccann", "Female" ],
117
126
  [ "5", "fafF1aBDebaB2a6", "Bobby", "Pittman", "Female" ]
@@ -123,9 +132,9 @@ result = parse.chunk(3) //Return row 2,3 and 4 (Get rows from last offset saved)
123
132
  result = parse.chunk(1) //Return row 5 (Get rows from last offset saved)
124
133
  /*
125
134
  {
126
- "Time": 0,
127
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
128
- "Rows": [
135
+ time: '0 ms',
136
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
137
+ rows: [
129
138
  [ "6", "BdDb6C8Af309202", "Calvin", "Ramsey", "Female" ]
130
139
  ],
131
140
  "row_count:": 1
@@ -150,9 +159,9 @@ result = parse.rowOffset(from,to)
150
159
  result = parse.rowOffset(6) //Returns all rows from the sixth row to the last row
151
160
  /*
152
161
  {
153
- "Time": 0,
154
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
155
- "Rows": [
162
+ time: '0 ms',
163
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
164
+ rows: [
156
165
  [ "7", "FCdfFf08196f633", "Collin", "Allison", "Male" ],
157
166
  [ "8", "356279dAa0F7CbD", "Nicholas", "Branch", "Male" ],
158
167
  [ "9", "F563CcbFBfEcf5a", "Emma", "Robinson", "Female" ],
@@ -165,9 +174,9 @@ result = parse.rowOffset(6) //Returns all rows from the sixth row to the last ro
165
174
  result = parse.rowOffset(5,8) //Returns all rows from 5th to 8th row
166
175
  /*
167
176
  {
168
- "Time": 1,
169
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
170
- "Rows": [
177
+ time: '1 ms',
178
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
179
+ rows: [
171
180
  [ "6", "BdDb6C8Af309202", "Calvin", "Ramsey", "Female" ],
172
181
  [ "7", "FCdfFf08196f633", "Collin", "Allison", "Male" ],
173
182
  [ "8", "356279dAa0F7CbD", "Nicholas", "Branch", "Male" ]
@@ -195,9 +204,9 @@ result = parse.setRowOffset(5)
195
204
  result = parse.chunk(1) // Get rows from last offset saved
196
205
  /*
197
206
  {
198
- "Time": 0,
199
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
200
- "Rows": [
207
+ time: '0 ms',
208
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
209
+ rows: [
201
210
  [ "6", "BdDb6C8Af309202", "Calvin", "Ramsey", "Female" ]
202
211
  ],
203
212
  "row_count:": 1
@@ -212,9 +221,9 @@ false
212
221
  result = parse.chunk(1) // Get rows from last offset saved
213
222
  /*
214
223
  {
215
- "Time": 0,
216
- "Header": [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
217
- "Rows": [
224
+ time: '0 ms',
225
+ header: [ "Index", "User Id", "First Name", "Last Name", "Sex" ],
226
+ rows: [
218
227
  [ "7", "FCdfFf08196f633", "Collin", "Allison", "Male" ]
219
228
  ],
220
229
  "row_count:": 1
@@ -266,9 +275,9 @@ parse = parseText(
266
275
  result = parse.rowOffset(2)
267
276
  /*
268
277
  {
269
- "Time": 0,
270
- "Header": false,
271
- "Rows": [
278
+ time: '0 ms',
279
+ header: false,
280
+ rows: [
272
281
  [ "2", "751cD1cbF77e005", "Alisha", "Hebert", "Male" ]
273
282
  ],
274
283
  "row_count:": 1
@@ -282,9 +291,9 @@ option = {
282
291
  // delimiter: (String: get rows containing columns, false: get lines without columns)
283
292
  /*
284
293
  {
285
- "Time": 0,
286
- "Header": false,
287
- "Rows": [
294
+ time: '0 ms',
295
+ header: false,
296
+ rows: [
288
297
  [ "2,751cD1cbF77e005,Alisha,Hebert,Male" ] // No columns, just string (all line)
289
298
  ],
290
299
  "row_count:": 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "select-csv",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Fastest, simplest and most powerful package of all existing libraries in npmjs. It converts .csv files into an array and even into lines. It contains two important functions parseCsv that handles a csv file, you only need a link to the file. And parseText deals with text, and they both have the same roles and and methods",
5
5
  "keywords": [
6
6
  "csv",