wprestapi
v1.0.1
Published
NPM Package for WP REST API Verson 2
Downloads
7
Readme
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);
});