/sq

sq - Stream jQuery

Primary LanguageJavaScriptBSD 2-Clause "Simplified" LicenseBSD-2-Clause

sq - Stream jQuery

sq is a tool to execute coffee script expression including jquery to stdin stream or speciefied URL/file.

Install

$ npm install

Usage

sq  <coffee expression> [URL or filename...]

Example

$ echo '<html><body><h1>Hello World!</h1></body><html>' | sq '$("h1").text()'
Hello World!
$ sq '$("img").map -> this.src' https://jquery.com/
https://jquery.org/resources/members/famous.png
https://jquery.org/resources/members/mediatemple.png
https://jquery.org/resources/members/wordpress.png
https://jquery.org/resources/members/ibm.png
https://jquery.com/jquery-wp-content/themes/jquery/content/books/learning-jquery-4th-ed.jpg
https://jquery.com/jquery-wp-content/themes/jquery/content/books/jquery-in-action.jpg
https://jquery.com/jquery-wp-content/themes/jquery/content/books/jquery-succinctly.jpg
$ sq '$(".entry-title a").map -> $(this).text()' https://api.jquery.com/category/core/ https://api.jquery.com/category/css/
jQuery()
jQuery.holdReady()
jQuery.noConflict()
jQuery.sub()
jQuery.when()
.addClass()
.css()
.hasClass()
.height()
.innerHeight()
.innerWidth()
jQuery.cssHooks
jQuery.cssNumber
.offset()
.outerHeight()
.outerWidth()
.position()
.removeClass()
.scrollLeft()
.scrollTop()
.toggleClass()
.width()