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 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.Result = void 0;
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.Result = /*#__PURE__*/function () {
20
+ var Result = exports["default"] = /*#__PURE__*/function () {
21
21
  function Result() {
22
22
  _classCallCheck(this, Result);
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodejs-nomer",
3
- "version": "1.3.3",
3
+ "version": "1.3.6",
4
4
  "description": "NodeJS wrapper for nomer",
5
5
  "bin": {
6
6
  "nomer": "./bin/nomer"
package/src/result.js CHANGED
@@ -1,4 +1,4 @@
1
- export class Result {
1
+ export default class Result {
2
2
 
3
3
  static json(result) {
4
4
  const arr = [];
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
@@ -1,6 +0,0 @@
1
- FROM node:21-alpine3.18
2
-
3
- RUN npm init
4
- # use changes to package.json to force Docker not to use the cache
5
- # when we change our application's nodejs dependencies:
6
- EXPOSE 8001
@@ -1,14 +0,0 @@
1
- version: '3.3'
2
- services:
3
- node:
4
- build: ./
5
- environment:
6
- NODE_ENV: dev
7
- volumes:
8
- - ../:/usr/src/app
9
- - nodemodules:/usr/src/app/node_modules
10
- ports:
11
- - "8001:8001"
12
- command: "npm start"
13
- volumes:
14
- nodemodules: {}