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

livereload

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

livereload

LiveReload server

  • 0.9.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is livereload?

The livereload npm package allows developers to automatically refresh the browser whenever files are modified. This is particularly useful for web development, as it speeds up the development process by eliminating the need to manually refresh the browser to see changes.

What are livereload's main functionalities?

Automatic Browser Refresh

This feature sets up a LiveReload server that watches the specified directory (in this case, the 'public' directory). Whenever a file in this directory changes, the server will automatically refresh the browser.

const livereload = require('livereload');
const server = livereload.createServer();
server.watch(__dirname + '/public');

Custom File Extensions

This feature allows you to specify custom file extensions to watch. In this example, the server will only watch for changes in files with the extensions 'html', 'css', and 'js'.

const livereload = require('livereload');
const server = livereload.createServer({ exts: ['html', 'css', 'js'] });
server.watch(__dirname + '/public');

Excluding Files and Directories

This feature allows you to exclude certain files or directories from being watched. In this example, the server will ignore files with the '.map' extension and anything in the 'node_modules' directory.

const livereload = require('livereload');
const server = livereload.createServer({ exclusions: ['*.map', 'node_modules/**'] });
server.watch(__dirname + '/public');

Other packages similar to livereload

FAQs

Package last updated on 18 Mar 2021

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