Coder Social home page Coder Social logo

crowdin-node's Introduction

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

crowdin-node's People

Contributors

saulhoward avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.