Coder Social home page Coder Social logo

watcher's Introduction

Install

npm install -g watcher

Command Line

Output in the same folder

watcher src/

Output in the bin/ folder

watcher -o bin/ src/

Watch a single file

watcher src/application.coffee

Output Example

Let's start the watcher, it compiles everything it finds.

22:36:30 - compiled src/index.haml
22:36:30 - compiled src/soulver.coffee
22:36:30 - compiled src/soulver.less

Oops, we made an error:

22:36:56 - compiled src/soulver.coffee
bin/soulver.js: Error: Parse error on line 2: Unexpected '''
    at Object.parseError (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:470:11)
    at Object.parse (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:546:22)
    at Object.compile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:40:22)
    at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:140:33
    at Socket.<anonymous> (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:167:14)
    at Socket.emit (events.js:64:17)
    at Pipe.onread (net.js:348:51)

We fix the problem, save again and it goes back in order :)

22:37:15 - compiled src/soulver.coffee

Just Ctrl+C when you are done editing the files.

watcher's People

Contributors

mltucker avatar pokehanai avatar vjeux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

watcher's Issues

Please update npm package

right now the npm package doesn't work..

path.exists is now called `fs.exists`.

events.js:72
        throw er; // Unhandled 'error' event
          ^
Error: This socket is closed.
    at Socket._write (net.js:635:19)
    at doWrite (_stream_writable.js:221:10)
    at writeOrBuffer (_stream_writable.js:211:5)
    at Socket.Writable.write (_stream_writable.js:180:11)
    at Socket.write (net.js:613:40)
    at run (c:\Users\bodhiBit\AppData\Roaming\npm\node_modules\watcher\src\handlers.coffee:27:18)
    at Object.module.exports.coffee (c:\Users\bodhiBit\AppData\Roaming\npm\node_modules\watcher\src\handlers.coffee:34:14)
    at compile (c:\Users\bodhiBit\AppData\Roaming\npm\node_modules\watcher\src\watcher.coffee:321:20)
    at c:\Users\bodhiBit\AppData\Roaming\npm\node_modules\watcher\src\watcher.coffee:326:16
    at Object.cb [as oncomplete] (fs.js:168:19)

I can see the issue is fixed in this repo, but the npm package hasn't been update in 2 years..

Handle dependencies?

# main.less
@import "file.less";

When file.less is updated, it would be great to recompile main.less instead of compiling the useless file.less

Different directories for each type

We may not want to output HTML and JS files in the same directory.

Maybe an option

watcher --output-html html/ --output-css css/ --output-js js/ src/

Generate file but no content

watcher folder/
show this:
path.exists is now called 'fs.exists'.

folder\file.jade.html: CreateProcessW: The system cannot find the file specified.

by the way I'm in Win8 with Node.js in command prompt :/ thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.