socket-function 0.29.0 → 0.31.0
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/package.json +1 -1
- package/src/formatting/format.ts +11 -0
- package/src/webSocketServer.ts +1 -1
package/package.json
CHANGED
package/src/formatting/format.ts
CHANGED
|
@@ -247,6 +247,17 @@ export function formatNiceDateTime(time: number) {
|
|
|
247
247
|
return date.getFullYear() + " " + date.toLocaleString("default", { month: "long" }) + " " + date.getDate() + ", " + days[date.getDay()] + ", " + strTime;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
/** 2024 January 1, Monday, 12:53:02pm (4 months ago) */
|
|
251
|
+
export function formatVeryNiceDateTime(time: number) {
|
|
252
|
+
if (!time) {
|
|
253
|
+
return "";
|
|
254
|
+
}
|
|
255
|
+
if (typeof time !== "number") {
|
|
256
|
+
return String(time);
|
|
257
|
+
}
|
|
258
|
+
return `${formatNiceDateTime(time)} (${formatTime(Date.now() - time)})`;
|
|
259
|
+
}
|
|
260
|
+
|
|
250
261
|
/** YYYY/MM/DD */
|
|
251
262
|
export function formatDate(time: number) {
|
|
252
263
|
function p(s: number) {
|
package/src/webSocketServer.ts
CHANGED
|
@@ -302,7 +302,7 @@ export async function startSocketServer(
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
let nodeId = getNodeId(getCommonName(config.cert), port);
|
|
305
|
-
console.log(green(`Started Listening on ${nodeId} after ${formatTime(process.uptime() * 1000)}`));
|
|
305
|
+
console.log(green(`Started Listening on ${nodeId} (${host}) after ${formatTime(process.uptime() * 1000)}`));
|
|
306
306
|
|
|
307
307
|
return nodeId;
|
|
308
308
|
}
|