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

@voodoo.io/reloader

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voodoo.io/reloader

Simple module to run a function periodically.

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Reloader


npm version GitHub license CI pipeline Opened issues Opened PR DeepScan grade Code coverage

Purpose

Minimalist, efficient and performance focused module to run a function at a specific interval.

Compatibility

/!\ This module use async/await syntax, this is why you must have node 7.6+.

Supported and tested : >= 14

VersionSupportedTested
18.xyesyes
16.xyesyes
14.xyesyes
12.xnoyes
10.xnoyes
9.xnoyes
8.xnoyes
>= 7.6noyes

Installation

$ npm install @voodoo.io/reloader --save

Usage

Instantiation & init

const ConfigManager = require('@voodoo.io/reloader')
const configManager = new ConfigManager()

// create a config function that should be run every 2 seconds
configManager.addFunction("config", async () => {
  // my stuff to reload here ....
}, 2000)

await configManager.init()

Basic usage

If your function returns a result it's accessible through "get" method.

configManager.get('config')
// or
configManager.getAll()

Constructor params

Paramsdescription Default value
delayInterval in ms between two check, only60000 (1min)
one timer is used to check each function

Test

$ npm test

Coverage report can be found in coverage/.

Keywords

FAQs

Package last updated on 27 Dec 2022

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

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