ntpclient 1.1.2 → 1.1.4
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/README.md +1 -1
- package/cli.d.ts +1 -0
- package/cli.js +4 -3
- package/cli.js.map +1 -1
- package/package.json +13 -99
- package/src/cli.ts +3 -1
- package/CHANGELOG.md +0 -41
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# NTPClient [](https://www.npmjs.com/package/ntpclient)
|
|
2
2
|
|
|
3
3
|
TypeScript implementation of the NTP Client Protocol. Based on [node-ntp-client](https://github.com/moonpyk/node-ntp-client).
|
|
4
4
|
|
package/cli.d.ts
CHANGED
package/cli.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
"use strict";
|
|
2
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -9,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
13
|
+
const commander_1 = require("commander");
|
|
13
14
|
const fs = require("fs");
|
|
14
15
|
const path = require("path");
|
|
15
16
|
const _1 = require("./");
|
|
@@ -19,7 +20,7 @@ const packageJsonPath = fs.existsSync(defaultPackageJsonPath)
|
|
|
19
20
|
: path.join(__dirname, '../package.json');
|
|
20
21
|
const packageJson = fs.readFileSync(packageJsonPath, 'utf-8');
|
|
21
22
|
const { bin, description, version } = JSON.parse(packageJson);
|
|
22
|
-
|
|
23
|
+
commander_1.program
|
|
23
24
|
.name(Object.keys(bin)[0])
|
|
24
25
|
.version(version)
|
|
25
26
|
.description(description)
|
|
@@ -27,7 +28,7 @@ commander
|
|
|
27
28
|
.option('-p, --port <number>', 'Specify a custom NTP port')
|
|
28
29
|
.option('-t, --timeout <number>', 'Specify the timeout in milliseconds')
|
|
29
30
|
.parse(process.argv);
|
|
30
|
-
const commanderOptions =
|
|
31
|
+
const commanderOptions = commander_1.program.opts();
|
|
31
32
|
void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
33
|
try {
|
|
33
34
|
const date = yield new _1.NTPClient(Object.assign(Object.assign(Object.assign({}, (commanderOptions.server && { server: commanderOptions.server })), (commanderOptions.port && { port: commanderOptions.port })), (commanderOptions.timeout && { replyTimeout: commanderOptions.timeout }))).getNetworkTime();
|
package/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yCAA+C;AAC/C,yBAAyB;AACzB,6BAA6B;AAE7B,yBAA6B;AAE7B,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACpE,MAAM,eAAe,GAAG,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC;IAC3D,CAAC,CAAC,sBAAsB;IACxB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAE5C,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAC9D,MAAM,EAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE5D,mBAAS;KACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACzB,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,WAAW,CAAC;KACxB,MAAM,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;KAC5D,MAAM,CAAC,qBAAqB,EAAE,2BAA2B,CAAC;KAC1D,MAAM,CAAC,wBAAwB,EAAE,qCAAqC,CAAC;KACvE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvB,MAAM,gBAAgB,GAAG,mBAAS,CAAC,IAAI,EAAE,CAAC;AAE1C,KAAK,CAAC,GAAS,EAAE;IACf,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,IAAI,YAAS,+CAC3B,CAAC,gBAAgB,CAAC,MAAM,IAAI,EAAC,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAAC,CAAC,GAC9D,CAAC,gBAAgB,CAAC,IAAI,IAAI,EAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAC,CAAC,GACxD,CAAC,gBAAgB,CAAC,OAAO,IAAI,EAAC,YAAY,EAAE,gBAAgB,CAAC,OAAO,EAAC,CAAC,EACzE,CAAC,cAAc,EAAE,CAAC;QAEpB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,EAAE,CAAC;KAChB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAA,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,71 +3,14 @@
|
|
|
3
3
|
"bin": {
|
|
4
4
|
"ntpclient": "cli.js"
|
|
5
5
|
},
|
|
6
|
-
"deno": "edition-deno/src/index.ts",
|
|
7
6
|
"dependencies": {
|
|
8
|
-
"commander": "
|
|
7
|
+
"commander": "10.0.0"
|
|
9
8
|
},
|
|
10
9
|
"description": "A TypeScript implementation of the NTP Client Protocol",
|
|
11
10
|
"devDependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"@ffflorian/semantic-release-config": "0.5.0",
|
|
15
|
-
"@semantic-release/changelog": "5.0.1",
|
|
16
|
-
"@semantic-release/git": "9.0.0",
|
|
17
|
-
"@types/jasmine": "3.6.4",
|
|
18
|
-
"@types/node": "~14",
|
|
19
|
-
"@typescript-eslint/eslint-plugin": "4.0.0",
|
|
20
|
-
"@typescript-eslint/parser": "3.10.1",
|
|
21
|
-
"babel-eslint": "10.1.0",
|
|
22
|
-
"cpx": "1.5.0",
|
|
23
|
-
"eslint": "7.20.0",
|
|
24
|
-
"eslint-config-prettier": "8.0.0",
|
|
25
|
-
"eslint-plugin-import": "2.22.1",
|
|
26
|
-
"eslint-plugin-jasmine": "4.1.2",
|
|
27
|
-
"eslint-plugin-jsdoc": "32.1.0",
|
|
28
|
-
"eslint-plugin-no-unsanitized": "3.1.4",
|
|
29
|
-
"eslint-plugin-prettier": "3.3.1",
|
|
30
|
-
"eslint-plugin-simple-import-sort": "7.0.0",
|
|
31
|
-
"eslint-plugin-sort-keys-fix": "1.1.1",
|
|
32
|
-
"eslint-plugin-typescript-sort-keys": "1.5.0",
|
|
33
|
-
"husky": "5.1.0",
|
|
34
|
-
"jasmine": "3.6.4",
|
|
35
|
-
"lint-staged": "10.5.4",
|
|
36
|
-
"make-deno-edition": "1.2.0",
|
|
37
|
-
"prettier": "2.2.1",
|
|
38
|
-
"publish-flat": "1.4.1",
|
|
39
|
-
"rimraf": "3.0.2",
|
|
40
|
-
"semantic-release": "17.3.9",
|
|
41
|
-
"ts-node": "9.1.1",
|
|
42
|
-
"typescript": "4.1.5"
|
|
11
|
+
"rimraf": "4.1.2",
|
|
12
|
+
"typescript": "4.9.5"
|
|
43
13
|
},
|
|
44
|
-
"editions": [
|
|
45
|
-
{
|
|
46
|
-
"description": "TypeScript source code with import for modules",
|
|
47
|
-
"directory": "src",
|
|
48
|
-
"engines": false,
|
|
49
|
-
"entry": "src/index.ts",
|
|
50
|
-
"tags": [
|
|
51
|
-
"source",
|
|
52
|
-
"typescript",
|
|
53
|
-
"import"
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"description": "TypeScript source code made to be compatible with Deno",
|
|
58
|
-
"directory": "edition-deno",
|
|
59
|
-
"entry": "src/index.ts",
|
|
60
|
-
"tags": [
|
|
61
|
-
"typescript",
|
|
62
|
-
"import",
|
|
63
|
-
"deno"
|
|
64
|
-
],
|
|
65
|
-
"engines": {
|
|
66
|
-
"deno": true,
|
|
67
|
-
"browsers": false
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
14
|
"engines": {
|
|
72
15
|
"node": ">= 10.9"
|
|
73
16
|
},
|
|
@@ -80,50 +23,21 @@
|
|
|
80
23
|
"index.js.map",
|
|
81
24
|
"src"
|
|
82
25
|
],
|
|
83
|
-
"keywords": [
|
|
84
|
-
"deno",
|
|
85
|
-
"deno-edition",
|
|
86
|
-
"deno-entry",
|
|
87
|
-
"denoland"
|
|
88
|
-
],
|
|
89
26
|
"license": "GPL-3.0",
|
|
90
|
-
"lint-staged": {
|
|
91
|
-
"*.{json,md}": [
|
|
92
|
-
"prettier --write"
|
|
93
|
-
],
|
|
94
|
-
"spec/**/*.ts": [
|
|
95
|
-
"eslint --config .eslintrc.spec.json --fix"
|
|
96
|
-
],
|
|
97
|
-
"src/**/*.ts": [
|
|
98
|
-
"eslint --fix"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
27
|
"main": "index.js",
|
|
102
28
|
"name": "ntpclient",
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
"extends": "@ffflorian/semantic-release-config"
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"directory": "flattened"
|
|
106
31
|
},
|
|
107
|
-
"repository": "https://github.com/ffflorian/ntpclient
|
|
32
|
+
"repository": "https://github.com/ffflorian/node-packages/tree/main/packages/ntpclient",
|
|
108
33
|
"scripts": {
|
|
109
|
-
"build
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"fix": "yarn fix:other && yarn fix:ts",
|
|
115
|
-
"fix:other": "yarn prettier --write",
|
|
116
|
-
"fix:ts": "yarn lint:ts --fix && yarn lint:ts:spec --fix",
|
|
117
|
-
"flatten": "publish-flat -o flattened && yarn copy:source",
|
|
118
|
-
"lint": "yarn lint:ts && yarn lint:ts:spec && yarn lint:other",
|
|
119
|
-
"lint:other": "yarn prettier --list-different",
|
|
120
|
-
"lint:ts": "eslint --ignore-path .gitignore --ext .ts src/",
|
|
121
|
-
"lint:ts:spec": "eslint --ignore-path .gitignore --ext .ts --config .eslintrc.spec.json spec/",
|
|
122
|
-
"postversion": "node ../node_modules/publish-flat/cli-copy.js -i package.json -o ../package.json version",
|
|
123
|
-
"prettier": "prettier --ignore-path .gitignore \"*.{json,md}\"",
|
|
124
|
-
"release": "semantic-release",
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"clean": "rimraf dist",
|
|
36
|
+
"dist": "yarn clean && yarn build",
|
|
37
|
+
"flatten": "node ../publish-flat/dist/cli.js -o flattened",
|
|
38
|
+
"postversion": "node ../publish-flat/dist/cli-copy.js -o flattened/package.json version",
|
|
125
39
|
"start": "ts-node src/cli.ts",
|
|
126
|
-
"test": "ts-node -P tsconfig.jasmine.json node_modules/.bin/jasmine"
|
|
40
|
+
"test": "ts-node -P tsconfig.jasmine.json ../../node_modules/.bin/jasmine"
|
|
127
41
|
},
|
|
128
|
-
"version": "1.1.
|
|
42
|
+
"version": "1.1.4"
|
|
129
43
|
}
|
package/src/cli.ts
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
## [1.1.1](https://github.com/ffflorian/ntpclient/compare/v1.1.0...v1.1.1) (2021-02-19)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* Publish deno files to repository ([64c7f3d](https://github.com/ffflorian/ntpclient/commit/64c7f3dbd4b0432b88f1c6d59050a0f843639112))
|
|
7
|
-
|
|
8
|
-
# [1.1.0](https://github.com/ffflorian/ntpclient/compare/v1.0.2...v1.1.0) (2021-02-19)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Features
|
|
12
|
-
|
|
13
|
-
* Deno edition ([#572](https://github.com/ffflorian/ntpclient/issues/572)) ([ab0b63f](https://github.com/ffflorian/ntpclient/commit/ab0b63fb51d1b986846ea92d99ad8053e1ec5bee))
|
|
14
|
-
|
|
15
|
-
## [1.0.2](https://github.com/ffflorian/ntpclient/compare/v1.0.1...v1.0.2) (2019-09-06)
|
|
16
|
-
|
|
17
|
-
### Bug Fixes
|
|
18
|
-
|
|
19
|
-
- Use postversion when publishing ([762781c](https://github.com/ffflorian/ntpclient/commit/762781c))
|
|
20
|
-
|
|
21
|
-
## [1.0.1](https://github.com/ffflorian/ntpclient/compare/v1.0.0...v1.0.1) (2019-06-14)
|
|
22
|
-
|
|
23
|
-
### Bug Fixes
|
|
24
|
-
|
|
25
|
-
- Use flattened dir to publish ([e431a72](https://github.com/ffflorian/ntpclient/commit/e431a72))
|
|
26
|
-
|
|
27
|
-
# [1.0.0](https://github.com/ffflorian/ntpclient/compare/v0.8.0...v1.0.0) (2019-06-13)
|
|
28
|
-
|
|
29
|
-
### Features
|
|
30
|
-
|
|
31
|
-
- New import structure, remove webpack ([1b6b324](https://github.com/ffflorian/ntpclient/commit/1b6b324))
|
|
32
|
-
|
|
33
|
-
### BREAKING CHANGES
|
|
34
|
-
|
|
35
|
-
- NTPClient is not a default export anymore and the 'dist' directory is omitted
|
|
36
|
-
|
|
37
|
-
# [0.8.0](https://github.com/ffflorian/ntpclient/compare/v0.7.3...v0.8.0) (2019-05-27)
|
|
38
|
-
|
|
39
|
-
### Features
|
|
40
|
-
|
|
41
|
-
- Force release ([a13fb26](https://github.com/ffflorian/ntpclient/commit/a13fb26))
|