🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@blued-core/healthchecks-client

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blued-core/healthchecks-client

latest
npmnpm
Version
0.1.1
Version published
Maintainers
4
Created
Source

healthchecks-client

示例

import { createWrapper, PingClientConfig } from '../src/index'

const config: PingClientConfig = {
  baseURL: '/healthchecks/host',
  checks: {
    test: '/healthchecks/test',
  }
}

const sleep = (ms: number) => new Promise(r => setTimeout(r, ms))

const test = async () => {
  console.log('test start')
  await sleep(1000)
  console.log('test end')
}

(async function main() {
  try {
    const wrapper = createWrapper(config)
    // 第二个参数必须是配置项 checks 中的 key
    await wrapper(test, 'test')()
  } catch (e) {
    console.error('error', e)
  }
})()

// 定时任务中使用
import { scheduleJob } from 'node-schedule'

scheduleJob('1 0 0 * * *', wrapper(test, 'test'))

FAQs

Package last updated on 22 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts