POEditor Sync
Synchronize translations with POEditor
Usage
Download JSON files
const POEditorSync = require('@motork/poeditor-sync').default;
// or with ES6
import POEditorSync from '@motork/poeditor-sync',
// Donwload files and write them in `output`
POEditorSync
.download({
api_token: '123qwe456rty789yui098poi123qwe12', // POEditor API KEY
id: '33333', // project ID
type: 'key_value_json', // Type of the file to download - default: key_value_json
languages: ['de', 'en', 'es', 'fr', 'it'], // List of languages to download - default: 'de', 'en', 'es', 'fr', 'it'
output: `${__dirname}/lang`,
log: true, // default: true
})
.then((values) => { // You can optionally, do something after files have been downloaded
values.forEach(({ status, value }) => {
// status -> Promise status: fulfilled, rejected
// value -> Downloaded file info: value.url, value.output, value.language, value.type
});
});
Development
npm i
Test
npm test
Build
npm run build