fix(core): update

This commit is contained in:
2022-10-21 11:55:42 +02:00
parent f479c11574
commit d479cd9e7e
7 changed files with 69 additions and 6 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartping',
version: '1.0.4',
version: '1.0.5',
description: 'a ping utility'
}

View File

@ -1,3 +1,3 @@
import * as plugins from './smartping.plugins.js';
export let demoExport = 'Hi there! :) This is an exported string';
export * from './smartping.classes.smartping.js';

View File

@ -0,0 +1,22 @@
import * as plugins from './smartping.plugins.js';
export class Smartping {
public async ping(hostArg: string, timeoutArg: number = 500): Promise<plugins.ping.PingResponse> {
const result = await plugins.ping.promise.probe(hostArg, {
timeout: timeoutArg
})
return result;
}
public async pingAlive(hostArg: string, timeoutArg: number = 500): Promise<boolean> {
const result = await plugins.ping.promise.probe(hostArg, {
timeout: timeoutArg
}).catch();
//console.log(result);
if (result.alive) {
return true;
} else {
return false;
}
}
}

View File

@ -1,2 +1,5 @@
const removeme = {};
export { removeme };
import ping from 'ping';
export {
ping
}