Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ofirdagan/pingdom

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ofirdagan/pingdom - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

dist/services/logger.d.ts

12

dist/pingdom.js

@@ -8,2 +8,5 @@ "use strict";

const axios_1 = __importDefault(require("axios"));
const axios_retry_1 = __importDefault(require("axios-retry"));
const logger_1 = require("./services/logger");
(0, axios_retry_1.default)(axios_1.default, { retryDelay: (retryCount) => retryCount * 300 });
const THREE_MIN = 1000 * 60 * 3;

@@ -15,5 +18,10 @@ function monitor(serviceName, apiKey) {

exports.monitor = monitor;
function reportAlive(serviceName, apiKey) {
axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, { headers: { 'x-api-key': apiKey } });
async function reportAlive(serviceName, apiKey) {
try {
await axios_1.default.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, { headers: { 'x-api-key': apiKey } });
}
catch (e) {
(0, logger_1.log)('exception in reporting ping', e);
}
}
//# sourceMappingURL=pingdom.js.map

5

package.json
{
"name": "@ofirdagan/pingdom",
"version": "1.0.4",
"version": "1.0.5",
"description": "my own lightweight version of pingdom (service monitoring)",

@@ -25,3 +25,4 @@ "main": "dist/pingdom.js",

"dependencies": {
"axios": "^0.24.0"
"axios": "^0.24.0",
"axios-retry": "^3.2.4"
},

@@ -28,0 +29,0 @@ "devDependencies": {

@@ -8,7 +8,8 @@ # PingDom

* Add a new service (service name must be unique and **without spaces/ special characters**)
* copy your API key
* In your project `npm install @ofirdagan/pingdom`
* In your code:
```js
import {init} from '@ofirdagan/pingdom';
init(serviceName);
import {monitor} from '@ofirdagan/pingdom';
monitor(serviceName, apiKey);
```
import axios from 'axios';
import axiosRetry from 'axios-retry';
import {log} from './services/logger';
axiosRetry(axios, { retryDelay: (retryCount) => retryCount * 300 });
const THREE_MIN = 1000 * 60 * 3;

@@ -10,4 +12,8 @@

function reportAlive(serviceName: string, apiKey: string) {
axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, {headers: {'x-api-key': apiKey}});
}
async function reportAlive(serviceName: string, apiKey: string) {
try {
await axios.get(`https://ofird11.editorx.io/pingdom/_functions/ping/${serviceName}`, {headers: {'x-api-key': apiKey}});
} catch (e) {
log('exception in reporting ping', e);
}
}
import {monitor} from '../src/pingdom';
monitor('test');
monitor('test', 'wrong-api-key');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc