Skip to content


Subversion checkout URL

You can clone with
Download ZIP


libsass does not accept parsing from stdin #55

mingodad opened this Issue · 6 comments

4 participants


Testing sassc I noticed that it doesn't accept input from stdin and looking to implement that I found that libsass doesn't accept input from stdin because it tries to fstat a file name to get it's size and preallocate memory to ready it all in memory.

Would be nice if we could use sassc/libsass accepts input from stdin that way it could be part of a sequence of filters through redirection.

cat some.scss | sed | sassc | sed | ...


Given the way that the LibSass tokenizer is implemented, LibSass itself will probably not be able to stream from stdin. It would be better for the caller/wrapper to read everything from stdin and pass it to LibSass as a string. I'll close this ticket and open a corresponding one in the SassC repo.

@akhleung akhleung closed this

Any news on this feature ?


@franckbret LibSass is a pure library. It doesn't execute itself. SassC is the counterpart to libsass that allows you to read from stdin.


Thanks for your answer. Btwi don't get why i can't see this option when I run ./bin/sassc --help

I've seen this merge, quite old but with stdin support at the sassc level, so I supposed it was ok... sass/sassc#44

Now I really miss something...

Looks like I run sassc version 0.4.2

./bin/sassc --version
sassc 0.4.2

./bin/sassc --help
Usage: sassc [options] SCSS_FILE [OUT_CSS_FILE]

  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -s STYLE, --output-style=STYLE
                    Coding style of the compiled result.  Choose one of
                    compact, expanded, compressed, or nested. [default:
   -m, -g, --sourcemap   Emit source map.  Requires the second argument (output
                    css filename).
   -I DIR, --include-path=DIR
                    Path to find "@import"ed (S)CSS source files.  Can be
                    multiply used.
   -i DIR, --image-path=DIR
                    Path to find images. [default: ./]
   -w, --watch           Watch file for changes.  Requires the second argument
                    (output css filename).

Obviously if i give something from stdin or if I use --stdin arg, it fails. Why do ./bin/sassc doesn't give the same options as I can see there ?

Thanks in advance


Sure, thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.