Mohammad Asif cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
..
.github cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
dist cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
docs cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
samples cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
src cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
test cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
.env.example cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
.eslintignore cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
.eslintrc.js cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
.nycrc cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
CHANGELOG.md cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
LICENSE cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
README.md cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
index.js cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
package.json cf937194cb Removed un-waned things 1. 10 tháng trước cách đây
tsconfig.json cf937194cb Removed un-waned things 1. 10 tháng trước cách đây

README.md

Lokalise API v2 official Node.js client

npm CI Test Coverage Downloads total

Official Node interface for the Lokalise API.

Quickstart

Install the library:

npm install @lokalise/node-api@~8.0.2

Obtain Lokalise API token in your personal profile, initialize and use the client:

const { LokaliseApi } = require('@lokalise/node-api');

const lokaliseApi = new LokaliseApi({ apiKey: '<apiKey>'});
const projects = await lokaliseApi.projects().list();
projects.items[0].name;

process = await lokaliseApi.files().upload(project_id,
  {data: data_base64, filename: 'test1.json', lang_iso: 'en'})
process.status // => 'queued'

Alternatively, you can use tokens obtained via OAuth2 (don't forget that these tokens have expiration dates):

const { LokaliseApiOAuth } = require('@lokalise/node-api');

const lokaliseApi = new LokaliseApiOAuth({ apiKey: '<apiKeyObtainedViaOauth2>' });

const projects = lokaliseApi.projects().list();

Usage

Detailed documentation can be found at lokalise.github.io/node-lokalise-api.

You can also check this repo containing some usage examples and this blog post with explanations.

License

This library is licensed under the BSD 3 Clause. Prior to version 5.1.0 the license was MIT.

Copyright (c) Lokalise group and Ilya Krukowski