Socket
Socket
Sign inDemoInstall

crowdin-node

Package Overview
Dependencies
83
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    crowdin-node

Download translations from Crowdin


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

crowdin-node

Node module for accessing the Crowdin API

Disclaimer

This is an unofficial API client library. Crowdin and the Crowdin API are the property of Crowdin, LLC.

Install

npm install crowdin

Usage

apiKey and endpointUrl parameters must be set to create the instance, an error will be thrown otherwise.

var crowdin = new Crowdin({
    apiKey: '7d38782fa7cb4b6a9fbae2de65e91989',
    endpointUrl: 'https://api.crowdin.net/api/project/<your-project>'
});

API

.requestData(Object parameters)

Returns a Promise of a call to the API endpoint with specified parameters.
Parses the response body and rejects if the API returns an error.

.getRequest(String endpoint)

Returns a Promise of a GET request to the set API endpoint. Uses requestData().

.postRequest(String endpoint)

Returns a Promise of a POST request to the set API endpoint. Uses requestData().

.getInfo()

Returns a Promise of project information. Uses postRequest().

.getLanguages()

Returns a Promise of project languages. Uses getInfo().

.export()

Returns a Promise of an API call to the export endpoint. Uses getRequest().

.download()

Downloads the translations ZIP and returns the Stream.
You might call export() before to ensure you have the latest translations.

.downloadToStream(Stream)

Downloads the translations ZIP to the specified stream. Uses download() and returns an empty Promise.

.downloadToZip(String path)

Downloads the translations ZIP to the specified path. Uses download() and returns an empty Promise.

.downloadToPath(String path)

Downloads and extracts the translations ZIP to the specified path. Uses download() and returns an empty Promise.

.downloadAndParse()

Downloads and parses the translations ZIP. Uses download() and returns the Stream of file entries. See the node-unzip documentation.

.downloadToObject()

Downloads, extracts and converts the translations ZIP to a JS object. Returns a Promise.

Tests

Tests are written with mocha

npm test

Coverage using istanbul

npm run coverage

License

Apache 2.0
Copyright 2015 Hailo

Keywords

FAQs

Last updated on 10 Nov 2017

Did you know?

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc