A node.js JavaScript client for working with WordPress.
Requires WordPress 3.4 or newer (uses the WordPress XML-RPC API).
npm install wordpress
Include the wordpress package
var wordpress = require('wordpress');
var wpClient = wordpress.createClient({
"url": 'http://yourwordpressURL',
"username": 'user',
"password": 'pwd'
});wpClient.newPost({
title: 'Your title',
status: 'publish', //'publish, draft...',
content: '<strong>This is the content</strong>',
termNames: {'category': ['cate1', 'cate2'], 'post_tag':['tag1', 'tag2']}
},
function() {
console.log(arguments);
}
});MIT license