A small javascript/nodejs client for CourtListener
Note this is early code, still under development.
This module is installed via npm:
$ npm install courtlistener
Node-Courtlistener is a client side library for getting cases form CourtListener.
The client follows a chained pattern
var CLClient = require('courtlistener')
, courtlistener = new CLClient();
Set the login/username for CourtListener
courtlistener.login(username, password)
- Downloads a case matching the citation string to the current destination path for downloads.
- If no value is passed, it will use the value that is currently passing down the chain.
- Will pass the case or array of cases down the chain on completion.
courtlistener
.login([username], [password])
.getCases(['140 U.S. 22', '100 U.S. 50'])
.getCase('50 U.S. 175')
- Gets an array of case objects from the current case on the chain.
- If no value is passed, it will use the value that is currently passing down the chain.
- Will pass the case or array of cases down the chain on completion.
courtlistener
.login([username], [password])
.getCase('50 U.S. 175')
.citedBy()
.display()
.run()
Downloads case(s) with citation object(s) from the chain to the current destination path
courtlistener
.login([username], [password])
.display('***Running Court Listener Script***')
.getCase('50 U.S. 175')
.citedBy()
.set('cites_50_US_175') // store the cites array
.getCase('140 U.S. 192')
.get('cites_50_US_175') //retrieve the array
.to('cites_50_US_175')
.getCitations() //then get those cases
.display()
.run()
- Sets destination path
- Sets the throttle delay between group requests such as
.getCases()
orgetCitations()
courtlistener
.login(username, password)
.display('***Running Court Listener Script***')
.to('cases')
.getCase('50 U.S. 175')
.citedBy()
.set('throttle', 1000) //set 1 second in between API calls
.getCases()
.run()
Display [value]
to the console, or when no value is passed, display the value currently
in the chain.
Run the script, passing [value]
to the first method in the chain.
See http://www.github.com/zornstar/diva for additional methods that can be used with the CourtListener object instance, e.g.:
- Event Listeners: before, after
- Storage/Retrieval: set, get
- Fork: Fork a value off of the chain
var CLClient = require('courtlistener')
, courtlistener = new CLClient();
courtlistener
.login([username], [password])
.display('***Court listener***') //display ***Court listener*** to console
.login('username', 'password') //login
.to('386 U.S. 738') //set the destination path for downloaded files
.getCase('386 U.S. 738') //search for 386 U.S. 738 and download
//the case to the destination folder
.cites() //get all of the cites for '386 U.S. 738'
.display() //display to the console all of the cites for 386 U.S. 738
.to('cited_cases') // set the destination path for downloaded files
.getCitations() // download all of the cited cases for '386 U.S. 738'
.run()