Miss any of our Open RFC calls?Watch the recordings here! »

rooftop-client

0.2.1 • Public • Published

rooftop

npm tests dependencies

node api client for Rooftop CMS

Note: This project is in early development, and versioning is a little different. Read this for more details.

Installation

npm i rooftop-client -S

Note: This project only supports Node 6+

Usage

const Rooftop = require('rooftop-client')
 
const api = Rooftop.new({
  url: 'https://yoursubdomain.rooftopcms.io',
  apiToken: 'xxx'
})
 
// get all posts
api.posts.get().then(console.log)
 
// get all case studies (custom field example)
api.caseStudies.get().then(console.log)
 
// get the first 5 posts
api.posts.get(5).then(console.log)
 
// get only posts with content matching the search query
// see http://v2.wp-api.org/reference/posts/ for possible params
api.posts.get({ search: 'hello' }).then(console.log)

Testing

To run the tests locally, you'll need to add a test/.env with your name and token values:

License & Contributing

Keywords

none

Install

npm i rooftop-client

DownloadsWeekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • avatar