New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

drudge

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

drudge

Drudge watches and serves your files while also acting as a LiveReload server

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Drudge

drudge - NOUN someone who has to do a lot of boring and unpleasant work

Drudge watches and serves your files while also acting as a LiveReload server.

File watching and live reloading are hard. I haven't had any luck with the existing solutions. So, I perused npm and pulled together the most popular modules for the respective jobs:

  • tiny-lr for the LiveReload server
  • chokidar for the file watcher
  • st for the static file server

They work really well together! Yay, UNIX philosophy!

As for the livereload client, you need to install the browser extension or add the livereload script tag manually.

Installation

Drudge is a node.js program, so you want to to install that first.

npm install [-g] drudge

Usage (CLI)

drudge -h 

Usage: bin [options]

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -d, --dir [DIRECTORY]  Serve the contents of DIRECTORY (default=cwd)
    -i, --index [INDEX]    Use the specified INDEX filename as the result when a directory is requested. (default=index.html)
    -p, --port [PORT]      Listen on PORT (default=3000)
    -t, --passthrough      Return INDEX for missing files instead of 404.
    -q, --quiet            Turn off logging

The passthrough options is especially useful when your developing a "Single Page Application" where you do all the routing on the client. The server simply returns your app instead of a 404 Not Found.

Example

drudge -d static -p 1337 -t
  server Watching /Users/clemens/Projects/drudge/static +0ms
  server LiveReload listening on http://localhost:35729 +10ms
  server HTTP Server listening on http://localhost:1337 +1ms

or combine it with watchify to reload your bundled javascript:

watchify index.js -o public/bundle.js & drudge -d public

Now everytime you change a file in your project, watchify will update the bundle and drudge will subsequently trigger a reload in the browser.

Usage as a module

var drudge = require('drudge')

TODO

  • expose more options
  • expose proper node.js API

Issues, requests and PRs welcome! :)

License

ISC

Keywords

FAQs

Package last updated on 23 Nov 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