@motork/poeditor-sync

1.0.9 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @motork/poeditor-sync

Weekly Downloads

30

Version

1.0.9

License

GPL-3.0

Unpacked Size

213 kB

Total Files

16

Last publish

Collaborators

  • cristian.frumusanu.motork
  • motork-user
  • davidet16
  • davidefavia.motork
  • drivek-ske
  • paolo.cavanna