Socket
Socket
Sign inDemoInstall

poeditor-utils

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poeditor-utils

high-level POEditor API utilities


Version published
Maintainers
1
Created
Source

poeditor-utils

Build Status

high-level POEditor API utilities for Node.js

  • based around poeditor-client
  • API is a subject to change
var utils = require('poeditor-utils');

utils.getProject(apiToken, projectName)

  • apiToken String POEditor API token
  • projectName String POEditor project name

Returns a promise which resolves with a poeditor-client Project representation of the project. See the docs there for more.

utils.getProject('my token', 'my project')
.then(function (project) {
	console.log(project); // Project {...}
});

utils.pullTranslations(apiToken, projectName, getPathCallback)

  • apiToken String POEditor API token
  • projectName String POEditor project name
  • getPathCallback(translation) Function produces destination file path for given translation
    • translation Object translation of a single term to a single language
      • translation.term String
      • translation.language String
      • translation.value String

Gets translations for all the project languages and writes them to files as produced by getPathCallback as a stable sorted JSON. Returns a promise which resolves with an Iterable of output files.

utils.pullTranslations('my token', 'my project', function (translation) {
	console.log(translation); // Translation {...}
	return 'my-translations/' + translation.language + '.json';
})
.then(function (files) {
	console.log(files); // ['my-translations/en.json', ...]
});

utils.Client

Exposes the poeditor-client Client for practicality. See the docs there for more.

new utils.Client(apiToken)

  • apiToken: POEditor API token
var client = new utils.Client('my token');

Keywords

FAQs

Package last updated on 06 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc