src/live.js
function watchChanges(io, params) {
    const folder = process.cwd();
    return watch(folder, { recursive: true }, () => {
        emitInfo('changes detected. Recompiling...');
        io.sockets.emit('load');
        const start = new Date().getTime();
        executeWithParams(params)
            .tap(alerts => {
                const ellapsed = new Date().getTime() - start;
                emitSuccess(`wow! recompiled and executed in ${ellapsed}ms!`);
                io.sockets.emit('update', compileMarkdown(alerts));
            })
            .catch(err => {
                emitError(`hot compilation error, baby: ${err.message}`);
                io.sockets.emit('failure', err.stack);
            });
    });
}
function watchChanges(io, params) {
    const folder = process.cwd();
    return watch(folder, { recursive: true }, () => {
        emitInfo('changes detected. Recompiling...');
        io.sockets.emit('load');
        const start = new Date().getTime();
        executeWithParams(params)
            .tap(alerts => {
                const ellapsed = new Date().getTime() - start;
                emitSuccess(`wow! recompiled and executed in ${ellapsed}ms!`);
                io.sockets.emit('update', compileMarkdown(alerts));
            })
            .catch(err => {
                emitError(`hot compilation error, baby: ${err.message}`);
                io.sockets.emit('failure', err.stack);
            });
    });
}
function watchChanges ( io , params ) { const folder = process . cwd ( ) ; return watch ( folder , { recursive : true } , ( ) => { emitInfo ( 'changes detected. Recompiling...' ) ; io . sockets . emit ( 'load' ) ; const start = new Date ( ) . getTime ( ) ; executeWithParams ( params ) . tap ( alerts => { const ellapsed = new Date ( ) . getTime ( ) - start ; emitSuccess ( ` ${ ellapsed } ` ) ; io . sockets . emit ( 'update' , compileMarkdown ( alerts ) ) ; } ) . catch ( err => { emitError ( ` ${ err . message } ` ) ; io . sockets . emit ( 'failure' , err . stack ) ; } ) ; } ) ; }
Watches folder for file changes, hot recompiling everything and notifying
the clients

@param {SocketIO} io
@param {Object} params
@return {Object}
Watches folder for file changes hot recompiling everything and notifying the clients