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

juke

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

juke

File watcher utility that provides interface to alter processing during watch session.

  • 0.0.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

juke

File watcher utility that provides interface to change processing behavior during watch session.

Inspired by jest --watch.

The dream: A reusable utility that enables engineers to quickly toggle watcher behavior during development.

Run the juke example implementation

Installation

$ npm i --save-dev juke

Example Usage

const CLIEngine = require("eslint").CLIEngine;
const formatter = require('eslint/lib/formatters/stylish')
const Juke = require('../../index.js');

const SOURCE_PATHS = [__dirname + '/app/**/*.js'];

const lint = (paths) => {
  console.log('Linting...');
  const cli = new CLIEngine();
  const report = cli.executeOnFiles(paths);
  console.log(formatter(report.results));
  console.log('done.');
};

const lintAll = lint.bind(null, SOURCE_PATHS);
const lintChanged = (path) => lint([path]);

// instantiate juke
const juke = new Juke(SOURCE_PATHS, lintAll);

// press "o" to lint only files that change
juke.directive('o', lintChanged, 'only lint changed files');

// press "a" to lint all source files
juke.directive('a', lintAll, 'lint all files on file change');

FAQs

Package last updated on 21 Dec 2016

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