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

hotcode

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hotcode

File monitor script for local development.

  • 0.0.4
  • Source
  • npm
  • Socket score

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

hotcode

hotcode screenshot

Since it is a totally separate tool you don't have to integrate it into your project's backend and it works with any language.

What does hotcode do?

hotcode is a local development tool that allows you to watch for file changes on a local file path and reloads your web project as a result of a change.

This means you don't have to hit refresh every time you make a change and if the change is a css file it allows you to refresh the CSS without loosing state on the current page.

Install

npm install hotcode

How to use

  • Run hotcode in terminal
  • A browser window should now open up (it runs open http://host:port)
  • Insert url (http://projectname.mydomain.com) in "Url" input, press return.
  • Insert path (/var/www/projectname/) in "Watch path" input, press return.
  • Start making changes to files in the path and see how hotcode reloads the view.
  • Be more productive.

Args

hotcode -p 8000 -u vhost.local -s
  • -p [int] , port, 8080
  • -h [str] , host, vhost.local
  • -s, silent, doesn't open a browser window on start

Helper file (predefined paths for urls)

You can add a helper file to hotcode so that you don't have to enter the watch path every time you enter an url.

At ~/.hotcode you can insert:

module.exports = [
	{
		'regex': /http:\/\/(.+?).mydomain.com/
		, 'watches': function(regexMatches, callback) {
			callback(null, '/var/www/'+regexMatches[1]);
		}
	}
];

This makes it so that hotcode will insert the path /var/www/subdomain automatically when you insert an url matching the regex supplied.

Requirements

Add http://yourhost:8080/static/injected.js as a script on your project page or through a http proxy like Glimmerblocker.

Ordinary script tag

<script src="http://yourhost:8080/static/injected.js" type="text/javascript"></script>

Glimmerblocker

  • Open Glimmerblocker pref pane.
  • New rule.
  • Action: Whitelist URL, optinally modifying content.
  • Enter a match for the host.
  • Paste the following code (modified) in the javascript tabs input area:

 

var hcH = document.getElementsByTagName('HEAD').item(0);
var hcS= document.createElement("script");
hcS.type = "text/javascript";
hcS.src="http://yourhost:8080/static/injected.js";
hcH.appendChild(hcS);

Thanks

Keywords

FAQs

Package last updated on 19 Oct 2011

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