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

runner-generator-livereload

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

runner-generator-livereload - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

34

index.js

@@ -8,3 +8,4 @@ /**

var name = 'livereload',
const
name = 'livereload',
log = require('runner-logger').wrap(name);

@@ -14,5 +15,6 @@

function start ( config, done ) {
var chokidar = require('chokidar'),
const
chokidar = require('chokidar'),
server = require('tiny-lr')(),
watcher;
watcher = chokidar.watch(config.watch, config.watchOptions);

@@ -36,3 +38,2 @@ function handler ( fileName ) {

watcher = chokidar.watch(config.watch, config.watchOptions);
watcher

@@ -60,6 +61,9 @@ .on('change', handler)

function generator ( config, options ) {
var tasks = {},
instance;
function generator ( config = {}, options = {} ) {
const
tasks = {},
{prefix = name + ':', suffix = ''} = options;
let instance;
// sanitize and extend defaults

@@ -74,14 +78,13 @@ config = Object.assign({

}
}, config || {});
options = Object.assign(generator.options, options || {});
}, config);
tasks[options.prefix + 'config' + options.suffix] = function () {
tasks[prefix + 'config' + suffix] = function () {
log.inspect(config, log);
};
tasks[options.prefix + 'start' + options.suffix] = function ( done ) {
tasks[prefix + 'start' + suffix] = function ( done ) {
instance = start(config, done);
};
tasks[options.prefix + 'stop' + options.suffix] = function () {
tasks[prefix + 'stop' + suffix] = function () {
stop(instance);

@@ -95,9 +98,2 @@ instance = null;

// defaults
generator.options = {
prefix: name + ':',
suffix: ''
};
// export main actions

@@ -104,0 +100,0 @@ generator.methods = {

{
"name": "runner-generator-livereload",
"version": "1.1.1",
"version": "2.0.0",
"description": "Tasks generator for LiveReload.",

@@ -18,8 +18,8 @@ "author": {

"dependencies": {
"chokidar": "^2.0.4",
"runner-logger": "^1.0.1",
"chokidar": "^3.0.0",
"runner-logger": "^2.0.0",
"tiny-lr": "^1.1.1"
},
"devDependencies": {
"cjs-eslint": "^1.1.1"
"cjs-eslint": "^1.2.4"
},

@@ -26,0 +26,0 @@ "keywords": [

@@ -24,3 +24,3 @@ Tasks generator for LiveReload

```js
var generator = require('runner-generator-livereload');
const generator = require('runner-generator-livereload');
```

@@ -31,3 +31,3 @@

```js
var tasks = generator({
const tasks = generator({
watch: [

@@ -43,3 +43,3 @@ 'build/develop/**/*',

```js
var runner = require('runner');
const runner = require('runner');

@@ -46,0 +46,0 @@ Object.assign(runner.tasks, tasks);

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