
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@lokalise/node-api
Advanced tools
Official Node interface for the Lokalise API.
Looking for a simple solution to perform translation uploading/downloading? Try the new lokalise-file-exchange package.
Please note that starting from version 9 this SDK is a pure ESM module. It does not provide a CommonJS export (require
) anymore. Therefore you should either convert your project to ESM, use dynamic import (please find an example below), or stay on version 8.
Install the library:
npm install @lokalise/node-api
Obtain Lokalise API token in your personal profile, initialize and use the client:
import { LokaliseApi } from "@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):
import { LokaliseApiOAuth } from "@lokalise/node-api";
const lokaliseApi = new LokaliseApiOAuth({ apiKey: '<apiKeyObtainedViaOauth2>' });
const projects = lokaliseApi.projects().list();
Here's an example using dynamic import:
(async function () {
const LokaliseApi = await (import('@lokalise/node-api').then(m => m.LokaliseApi));
const lokaliseApi = new LokaliseApi({ apiKey: LOKALISE_API_TOKEN});
// use lokaliseApi here as usual...
})();
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. Finally, you might be interested in our free course "Lokalise for developers" that showcases Node SDK usage.
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
FAQs
Official Lokalise API 2.0 Node.js client
The npm package @lokalise/node-api receives a total of 113,806 weekly downloads. As such, @lokalise/node-api popularity was classified as popular.
We found that @lokalise/node-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 open source maintainers collaborating on the project.
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.