w-data-csv 1.0.5 → 1.0.6

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.
@@ -9,7 +9,7 @@ jobs:
9
9
 
10
10
  strategy:
11
11
  matrix:
12
- node-version: [18.x]
12
+ node-version: [20.x]
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * w-data-csv v1.0.5
2
+ * w-data-csv v1.0.6
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
@@ -48,7 +48,7 @@
48
48
  <pre class="prettyprint source linenums"><code>import fs from 'fs'
49
49
  import csvParse from 'csv-parser'
50
50
  import stripBom from 'strip-bom-stream'
51
- import get from 'lodash-es/get'
51
+ import get from 'lodash-es/get.js'
52
52
  import genPm from 'wsemi/src/genPm.mjs'
53
53
  import ltdtkeysheads2mat from 'wsemi/src/ltdtkeysheads2mat.mjs'
54
54
  import getCsvStrFromData from 'wsemi/src/getCsvStrFromData.mjs'
@@ -232,7 +232,7 @@ export default WDataCsv
232
232
  <br class="clear">
233
233
 
234
234
  <footer>
235
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 21:31:55 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
235
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Mar 23 2024 16:13:15 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
236
236
  </footer>
237
237
 
238
238
  <script>prettyPrint();</script>
package/docs/global.html CHANGED
@@ -789,7 +789,7 @@
789
789
  <br class="clear">
790
790
 
791
791
  <footer>
792
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 21:31:55 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
792
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Mar 23 2024 16:13:15 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
793
793
  </footer>
794
794
 
795
795
  <script>prettyPrint();</script>
package/docs/index.html CHANGED
@@ -71,7 +71,7 @@
71
71
  <br class="clear">
72
72
 
73
73
  <footer>
74
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Mar 19 2024 21:31:55 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Sat Mar 23 2024 16:13:15 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
75
  </footer>
76
76
 
77
77
  <script>prettyPrint();</script>
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "w-data-csv",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "main": "dist/w-data-csv.umd.js",
5
5
  "dependencies": {
6
6
  "csv-parser": "^3.0.0",
7
7
  "lodash-es": "^4.17.21",
8
8
  "strip-bom-stream": "^5.0.0",
9
- "wsemi": "^1.7.47"
9
+ "wsemi": "^1.7.49"
10
10
  },
11
11
  "devDependencies": {
12
- "w-package-tools": "^1.0.73"
12
+ "w-package-tools": "^1.0.75"
13
13
  },
14
14
  "scripts": {
15
15
  "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
package/script.txt ADDED
@@ -0,0 +1,20 @@
1
+ #node --experimental-modules --es-module-specifier-resolution=node toolg/addVersion.mjs
2
+ node --experimental-modules --es-module-specifier-resolution=node toolg/modifyReadme.mjs
3
+
4
+ node --experimental-modules --es-module-specifier-resolution=node toolg/cleanFolder.mjs
5
+ ./node_modules/.bin/jsdoc -c .jsdoc
6
+
7
+ node --experimental-modules --es-module-specifier-resolution=node toolg/gDocsExams.mjs
8
+
9
+ node --experimental-modules --es-module-specifier-resolution=node toolg/gDistRollup.mjs
10
+
11
+ git add . -A
12
+ git commit -m 'modify: '
13
+ git push origin master:master
14
+
15
+ npm run deploy
16
+
17
+ #npm test
18
+
19
+ #npm publish
20
+
package/src/WDataCsv.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs from 'fs'
2
2
  import csvParse from 'csv-parser'
3
3
  import stripBom from 'strip-bom-stream'
4
- import get from 'lodash-es/get'
4
+ import get from 'lodash-es/get.js'
5
5
  import genPm from 'wsemi/src/genPm.mjs'
6
6
  import ltdtkeysheads2mat from 'wsemi/src/ltdtkeysheads2mat.mjs'
7
7
  import getCsvStrFromData from 'wsemi/src/getCsvStrFromData.mjs'
@@ -0,0 +1,3 @@
1
+ NAME,AGE
2
+ Daffy Duck,24
3
+ Bugs 邦妮,22
@@ -0,0 +1,3 @@
1
+ "name","value"
2
+ "大福 Duck",2.4
3
+ "Bugs 邦妮","2.2"
@@ -0,0 +1,14 @@
1
+ import assert from 'assert'
2
+ import wdc from '../src/WDataCsv.mjs'
3
+
4
+
5
+ describe('read', function() {
6
+
7
+ it('test read', async function() {
8
+ let fp = './g-test-in.csv'
9
+ let rin = await wdc.readCsv(fp)
10
+ let rout = [{ NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' }]
11
+ assert.strict.deepEqual(rin, rout)
12
+ })
13
+
14
+ })
@@ -0,0 +1,29 @@
1
+ import assert from 'assert'
2
+ import fs from 'fs'
3
+ import _ from 'lodash-es'
4
+ import wdc from '../src/WDataCsv.mjs'
5
+
6
+
7
+ describe('write', function() {
8
+
9
+ it('test write', async function() {
10
+
11
+ let r = [{ name: '大福 Duck', value: 2.4 }, { name: 'Bugs 邦妮', value: '2.2' }]
12
+ let fp = './g-test-out.csv'
13
+ await wdc.writeCsv(fp, r)
14
+
15
+ let rin = `"name","value"
16
+ "大福 Duck",2.4
17
+ "Bugs 邦妮","2.2"
18
+ `
19
+ rin = _.trim(rin)
20
+ rin = rin.replaceAll('\r\n', '\n')
21
+
22
+ let rout = fs.readFileSync('g-test-out.csv', 'utf8')
23
+ rout = _.trim(rout)
24
+ rout = rout.replaceAll('\r\n', '\n')
25
+
26
+ assert.strict.deepEqual(rin, rout)
27
+ })
28
+
29
+ })
package/test/all.test.mjs DELETED
@@ -1,10 +0,0 @@
1
- import assert from 'assert'
2
-
3
-
4
- describe('all', function() {
5
-
6
- it('test in localhost', function() {
7
- assert.strict.deepEqual(1, 1)
8
- })
9
-
10
- })