0.2.1 • Published 8 years ago

rooftop-client v0.2.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

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

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago