nodejs-nomer 1.3.3 → 1.3.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.
- package/DEVELOPMENT.md +26 -0
- package/bin/nomer +0 -0
- package/dist/result.js +2 -2
- package/package.json +1 -1
- package/src/result.js +1 -1
- package/test/script.js +46 -0
- package/Dockerfile +0 -6
- package/docker-compose.yml +0 -14
package/DEVELOPMENT.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# DEVELOPMENT
|
|
2
|
+
|
|
3
|
+
Build:
|
|
4
|
+
`npm run build`
|
|
5
|
+
|
|
6
|
+
Link:
|
|
7
|
+
|
|
8
|
+
`npm link`
|
|
9
|
+
|
|
10
|
+
Use package for testing:
|
|
11
|
+
`npm link nodejs-nomer`
|
|
12
|
+
|
|
13
|
+
Run `script.js`
|
|
14
|
+
`node script.js`
|
|
15
|
+
|
|
16
|
+
# PUBLISH
|
|
17
|
+
|
|
18
|
+
Update minor version:
|
|
19
|
+
`npm version minor`
|
|
20
|
+
|
|
21
|
+
Publish
|
|
22
|
+
`npm publish`
|
|
23
|
+
|
|
24
|
+
Push to git
|
|
25
|
+
`npm push`
|
|
26
|
+
|
package/bin/nomer
ADDED
|
Binary file
|
package/dist/result.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
9
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -17,7 +17,7 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
17
17
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
-
var Result = exports
|
|
20
|
+
var Result = exports["default"] = /*#__PURE__*/function () {
|
|
21
21
|
function Result() {
|
|
22
22
|
_classCallCheck(this, Result);
|
|
23
23
|
}
|
package/package.json
CHANGED
package/src/result.js
CHANGED
package/test/script.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const Nomer = require("nodejs-nomer")
|
|
2
|
+
|
|
3
|
+
const nomer = new Nomer.Nomer();
|
|
4
|
+
|
|
5
|
+
console.time("version")
|
|
6
|
+
console.log(nomer.version());
|
|
7
|
+
console.timeEnd("version")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
console.time("append async")
|
|
11
|
+
const process = nomer.appendAsync("col")
|
|
12
|
+
const resultsAsync = []
|
|
13
|
+
|
|
14
|
+
const result = (stdout) => new Promise(resolve => {
|
|
15
|
+
stdout.on('data', async (data) => {
|
|
16
|
+
console.log(data.toString())
|
|
17
|
+
return nomer.toObject(data).filter((obj) => obj.matchType !== "NONE")
|
|
18
|
+
|
|
19
|
+
})
|
|
20
|
+
stdout.on('end', () => {
|
|
21
|
+
resolve('end')
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
p = result(process.stdout)
|
|
26
|
+
for (let index = 0; index < 10; index++) {
|
|
27
|
+
process.stdin.write("\tBauhinia rufa\t\n")
|
|
28
|
+
}
|
|
29
|
+
process.stdin.end()
|
|
30
|
+
|
|
31
|
+
result.then((v) => console.log(v))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// console.time("append")
|
|
35
|
+
// const results = []
|
|
36
|
+
// for (let index = 0; index < 100; index++) {
|
|
37
|
+
// results.push(nomer.append("\tBauhinia rufa\t", "gbif"))
|
|
38
|
+
// }
|
|
39
|
+
// console.timeEnd("append")
|
|
40
|
+
|
|
41
|
+
// console.time("toObject")
|
|
42
|
+
// for (let index = 0; index < results.length; index++) {
|
|
43
|
+
// const element = results[index];
|
|
44
|
+
// nomer.toObject(element)
|
|
45
|
+
// }
|
|
46
|
+
// console.timeEnd("toObject")
|
package/Dockerfile
DELETED
package/docker-compose.yml
DELETED