Hacker News new | past | comments | ask | show | jobs | submit login

Find a way with entr[0] and an http server to tell the browser to reload the currently viewed file if it changes.

Today, entr allows you to restart a command when a file changes.

A web server allows you to serve local files to your browser.

If you use npm, lots of libs allow you to serve your web ui, and make the browser reload the page when something has changed.

But this is tied to npm, and even to the framework you use (eg: angular has its own way).

It would be cool if we could have a way to do that for any tool/language. Like, could a tool tell the browser to reload, because that tool was restarted by entr due to a file change?

This would allow live preview on any kind of files, or maybe even program output in the browser without having to press F5 every time.

[0]: https://github.com/clibs/entr




If I'm understanding you correctly, then this combination of two tools from the same author will get you that:

https://github.com/cortesi/modd

https://github.com/cortesi/devd


Actually nice! Thanks! (Only works for html files, but that’s already good)


http://livereload.com/

https://www.npmjs.com/package/livereload

https://github.com/guard/guard-livereload

if you search for livereload + whatever framework/language you use, you will probably find an implementation that integrates nicely. but the cli works just fine for anything, really.


Intellij does this (for html files at least)


many projects allow web reload, see python httpwatcher for example.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: