
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
Provide xxl-job SDK for NodeJs.
npm install xxl-job
import express from 'express'
import type { JobHandler } from 'xxl-job'
import { createXxlJobExecutor } from 'xxl-job'
const jobHandlers = new Map<string, JobHandler>()
jobHandlers.set('nodejs_test', async (jobLogger, jobRequest, jobParams) => {
jobLogger.warn(`request: ${JSON.stringify(jobRequest)}, params: ${jobParams}`)
})
jobHandlers.set('nodejs_test_with_Kill', async (jobLogger, jobRequest, jobParams) => {
jobLogger.warn(`request: ${JSON.stringify(jobRequest)}, params: ${jobParams}`)
const { isKill } = jobRequest
for (let count = 1; count < 2000; count++) {
// do something
if (isKill())
throw new Error('Job has been killed')
}
})
const app = express()
app.use(express.json())
app.listen(8081, () => {
const xxlJobExecutor = createXxlJobExecutor({
app,
jobHandlers,
appType: 'express',
accessToken: 'default_token',
baseUrl: 'http://127.0.0.1:8081',
// 若IP不固定可以使用<dynamicIP>ĺŤ ä˝Ťç¬¦,程序会自动替换为当前IP
// baseUrl: 'http://<dynamicIP>:8081',
executorKey: 'executor-nodejs-express',
scheduleCenterUrl: 'http://127.0.0.1:8080/xxl-job-admin', // xxl-job address
})
xxlJobExecutor.initialization()
})
See the example folder for details
MIT License © 2022 ikexing-cn
FAQs
Provide xxl-job SDK for NodeJs.
We found that xxl-job demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.