poeditor-node-client

A lightweight Node.js client for POEditor

Usage no npm install needed!

<script type="module">
  import poeditorNodeClient from 'https://cdn.skypack.dev/poeditor-node-client';
</script>

README

POEditor-Node-Client

A lightweight Node.js client for POEditor

Installation

npm install poeditor-node-client

Usage

var poeditorClient = require('poeditor-node-client');


var client = new poeditorClient('api_token');
var params = {
    id: '123456',
    language: 'en',
    updating: 'terms_translations',
    overwrite: 1,
    sync_terms: 1,
    file: fs.createReadStream('pathtofile')
}


var request = client.upload(params);

request.onDone(function (data) {});
request.onDone(function (error, response, body) {});

Methods

Upload

Updates terms / translations.

client.upload({ ... });

Export

Returns the link of the file (expires after 10 minutes).

client.export({ ... });

List Projects

Returns the list of projects owned by user.

client.list();

List Languages

Returns project languages, percentage of translation done for each and the datetime (UTC - ISO 8601) when the last change was made.

client.listLanguages({ id: 'project_id' });

Set Debug

Logs response to console.

client.setDebug(true);