| Start |
|---|
| Autoreload on source code changes using nodemon The nodemon package makes it possible to automatically reload your program when you modify any file in the source code. Installing nodemon globally
Installing nodemon locallyIn case you don't want to install it globally
Using nodemonRun your program with This replaces the usual use of You can also add your nodemon startup as an npm script, which might be useful if you want to supply parameters and not type them out every time. Add package.json: This way you can just use |
Browsersync OverviewBrowsersync (opens new window) is a tool that allows for live file watching and browser reloading. It's available as a NPM package (opens new window). InstallationTo install Browsersync you'll first need to have Node.js (opens new window) and NPM installed. For more information see the SO documentation on Installing and Running Node.js (opens new window). Once your project is set up you can install Browsersync with the following command: This will install Browsersync in the local If you'd rather install it globally use the Windows UsersIf you're having trouble installing Browsersync on Windows you may need to install Visual Studio so you can access the build tools to install Browsersync. You'll then need to specify the version of Visual Studio you're using like so: This command specifies the 2013 version of Visual Studio. Basic UsageTo automatically reload your site whenever you change a JavaScript file in your project use the following command: Replace Advanced UsageBesides the command line interface that was described above Browsersync can also be used with Grunt.js (opens new window) and Gulp.js (opens new window). Grunt.jsUsage with Grunt.js requires a plugin that can be installed like so: Then you'll add this line to your Gulp.jsBrowsersync works as a CommonJS (opens new window) module, so there's no need for a Gulp.js plugin. Simply require the module like so: You can now use the Browsersync API (opens new window) to configure it to your needs. APIThe Browsersync API can be found here: https://browsersync.io/docs/api (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference