1.0.1 • Published 8 years ago

wprestapi v1.0.1

Weekly downloads
1
License
BSD-2-Clause
Repository
-
Last release
8 years ago

Number Formatter

Node package for the WordPress plug-in http://v2.wp-api.org/

Installation

'npm install wprestapi'

Usage

var wprestapi = require('wprestapi');
var host = "www.your-wp-site.com";

wpAPI.getPosts(host, function (json) {
    console.log(json);
});

var id = "20";
wpAPI.getPost(host, id, function (json) {
    console.log(json);                                                       
});

var id = "1";
wpAPI.getMedia(host, id, function (json) {
    console.log(json);                                                       
});

wpAPI.getPage(host, "34", function (json) {
    console.log(json);                                          
});