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

auto-reload

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-reload

To clear require cache, and auto reload module

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

node-reload

For node.js to reload the module ,which was to be load by require, automaticly.

example:

var fs = require('fs');
var reload = require('auto-reload');
var data = reload('./data');

// print data from module every sec
setInterval(function() {
    console.log(data.name);
}, 1000);

// update file every 5 secs
setInterval(function() {
	console.log('update!')
    var data = '{ "name":"' + random(100000, 999999) + '" }';
    fs.writeFile('./data.json', data);
}, 5000);

var random = function(min, max) {
    var range = max - min;
    var rand = Math.random();
    return (min + Math.round(rand * range));
};

Keywords

FAQs

Package last updated on 19 Sep 2014

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