Socket
Socket
Sign inDemoInstall

jobrun

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jobrun

Simple job runner for MongoDB


Version published
Maintainers
1
Install size
8.72 MB
Created

Readme

Source

Jobrun

Simple job runner for MongoDB

Usage

$ npm install --save jobrun

or

$ yarn add jobrun

Example of usage

const dbLink = 'mongodb://localhost:27017/jobrunner'; 

const myJb = new JobRun(dbLink);

const DELETE_UNACTIVE_USERS = 'delete unactive users';

myJb.createJob(DELETE_UNACTIVE_USERS, () => {
  User.remove({lastLogIn: {$lt: yourDate}});
});

(async () => {
  await myJb.start();
  await myJb.every(3000, DELETE_UNACTIVE_USERS);
})();

Documentation

  • createJob(url, cb)
  • start()
  • every(timeout, url)
  • stop(url)

Keywords

FAQs

Last updated on 13 Mar 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc