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

redbone

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redbone - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

lib/scandirSync.js

20

lib/redbone.js

@@ -10,2 +10,3 @@ const path = require('path');

const scandir = require('./scandir');
const scandirSync = require('./scandirSync');

@@ -87,4 +88,23 @@ const handleError = require('./handleError');

/**
* Watchers autoloader
* Read files in the dir dirrectory, and add watchers from them to redbone watch
* @param {String} dir path to dir
* @return {Function} redbone function to chain
*/
redbone.readWatchersSync = function readWatchersSync(dir) {
scandirSync(dir, function(file) {
const watchers = require(path.join(dir, file));
if (!isArray(watchers)) throw new RedboneError('Watchers is not an array');
watchers.forEach((watcher) => {
if (!(watcher.type && isString(watcher.type))) throw new RedboneError('Watcher type is not defined');
if (!(watcher.action && isFunction(watcher.action))) throw new RedboneError('Watcher action is not defined');
redbone.watch(watcher.type, watcher.action);
});
});
return redbone;
}
redbone.dispatcher = dispatcher;
redbone.Socket = Socket;
redbone.RedboneError = RedboneError;

2

package.json
{
"name": "redbone",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

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