cacheur
v0.6.13
Published
A modular HTTP / API result cacher and transformer that runs as a CLI application
Downloads
36
Maintainers
Readme
About
cacheur is a Node.js CLI tool for caching and transforming API results. It is built with modularity and simplicity in mind.
This application should work stable enough, but is still in heavy development.
Install
Install globally
$ npm install -g cacheur
Usage
Run cacheur
# Within the project dir cacheur can be called directly:
cacheur
# It is possible to manually set the project directory:
cacheur --dir "/C/Dropbox/Software Projekte/cbmodel/caches/"
Set up project
cacheur excepts a project directory that contains config files, containing the specific job settings and a project wide global _setting.yaml
file.
Example Jobs
See: /examples
Cache an generic JSON API
http:
url: https://api.github.com/repos/jquery/jquery/issues
queryString:
state: open
This will make a http request to the GitHub API at given url and cache the result. The optional queryString object may contain URL parameters. In this case ?state=open will be appended to the url. The cache will be updated every 10 seconds.
Fetch a CSV file
cacheExpiration: 360
timeout: 180
retryDelay: 30
http:
url: https://data.cityofnewyork.us/api/views/5b3a-rs48/rows.csv?accessType=DOWNLOAD
This fetches a bigger CSV file from, renews the cache every 360 seconds. It will wait 180 seconds before timeout (this might however be shortened by your network settings). If the request fails, cacheur will retry after 30 seconds.
Cache an SemanticMediaWiki ASK Query
Roadmap
- Transform data formats (CSV to JSON object)
- Support JSON Path Queries though an ?q= param
Run cacheur as a linux service
License
MIT © Simon Heimler