Mohammad Asif cf937194cb Removed un-waned things 1. | пре 6 месеци | |
---|---|---|
.. | ||
.github | пре 6 месеци | |
dist | пре 6 месеци | |
docs | пре 6 месеци | |
samples | пре 6 месеци | |
src | пре 6 месеци | |
test | пре 6 месеци | |
.env.example | пре 6 месеци | |
.eslintignore | пре 6 месеци | |
.eslintrc.js | пре 6 месеци | |
.nycrc | пре 6 месеци | |
CHANGELOG.md | пре 6 месеци | |
LICENSE | пре 6 месеци | |
README.md | пре 6 месеци | |
index.js | пре 6 месеци | |
package.json | пре 6 месеци | |
tsconfig.json | пре 6 месеци |
Official Node interface for the Lokalise API.
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();
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.
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