node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


Cascading Tree Sheets Command Line Interface

The Cascading Tree Sheets command line interface (cts-cli) provides command line utilities for manipulating data with CTS. This current includes:

  • Scraping data out of web pages


First install Node.js (, and then install CTS-cli with the Node package manager:

npm install -g cts-cli


    dscrape <CTS File> <URL>

Optional Arguments:
    --format fmt    Specify an output format for data. Valid formats are:
                      pretty (default)

    --verbose       Include helpful status and debugging messages in output.
                    If this flag is turned off, you can simply pipe the
                    command output into a file for saving.

The CTS File can either be a file on your filesystem or a "Github URL" of the
form github://USER/REPO/path/to/file.cts. DScrape will fetch the CTS file remotely
from Github and then apply it.

  Tries to load a scraper from the DScrape Scraper Repository:


  Uses a scraper at a pre-defined Github location:
   dscrape github://cts/dscrape/examples/reddit.cts

  Uses a scraper in a local file:

   dscrape reddit.cts


Install the project dependencies by running npm install in the project root. THen

And the following tools to develop with DScrape:

Building the Project

From the project root, type:

coffee --compile --output lib/ src/

This will create lib/dscrape.js for you, using src/ as source. The bin/dscrape executable relies on this library.

Included Examples

Run these examples from the project root.

  • Reddit

    ./bin/dscrape examples/reddit.cts


Several TODOs for this project exist:

  • Enable output for multiple serialization formats, to be toggled via command line. e.g.: JSON, YAML, etc.
  • Identify (and resolve) issues with JSDOM that cause it to behave differently from the browser