1.0.0 • Published 1 year ago

@landmineaknpm2/officiis-iure-facilis v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Lokalise API v2 official Node.js client

npm CI Coverage Status Downloads total

Official Node interface for the Lokalise API.

Quickstart

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 @landmineaknpm2/officiis-iure-facilis

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

import { LokaliseApi } from "@landmineaknpm2/officiis-iure-facilis";

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 "@landmineaknpm2/officiis-iure-facilis";

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

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

Here's an example using dynamic import:

(async function () {
  const LokaliseApi = await (import('@landmineaknpm2/officiis-iure-facilis').then(m => m.LokaliseApi));
  const lokaliseApi = new LokaliseApi({ apiKey: LOKALISE_API_TOKEN});

  // use lokaliseApi here as usual...
})();

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. Finally, you might be interested in our free course "Lokalise for developers" that showcases Node SDK usage.

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

utilityfileregular expressionscircularString.prototype.matchAllastexpressexeces-shimsserializerequalestreestreams2spechelpersjasminegetpyyamlqueryasyncescapereplayparseuninstallextraclassesloadingcharacterspasswordES5byteOffsetmacoscollection.es6gdpr@@toStringTagdomtapereal-timecloudwatches-shim APIroutegetintrinsicSymbol.toStringTagutilcomparebufferenvwidthdeep-clonecss variabledataflagpnpm9installerFunction.prototype.nameES6mergepolyfillnumberpatchinvariant[[Prototype]]String.prototype.triminoutputsinatrawritableproptypesspeedawskinesisjestajaxStyleSheetexpressionsettingsmkdirsdefineoptionschemeeast-asian-widthRxnopel10nECMAScript 6sequenceebstrimLeftauthenticationhandlerstoStringTagtouchlessqueuetostringtagcorshttpbrowserslistcss-in-jsnegative zero256prettypromisesInt8Arrayreadablepruneless.jsinternalcensordropWebSocketsameValueZeroparentguidlivewordbreakpreprocessorparsingupWeakMapiteratorwalkyamlclass-validatorpackagesdebugtslibwhatwgconfigurableenvironmentes2015mixinsinferencerequestttymodulesconnectSymbolWebSocketsECMAScript 2020coerciblewatchFilereact-hooksencryptionaccessorutilitiesArray.prototype.flatMapstdlibECMAScript 2015call-boundasciilengthrfc4122higher-orderarraysjwtsnstrimEndAsyncIteratorwebpackage managerinstallflatMapopendescriptionregularobjcall-bindmovetrimRightnested cssiedeepcopyES2019react-testing-libraryObject.fromEntriesArray.prototype.findLastIndexcolumnirq0es-abstracteslintplugineverypropertycreateflagsdataviewmatchescallsignalsfilterappserializegrouprdsassignfile systemrobustes2018sigtermsimpledbformECMAScript 2019fasttypaniona11yresolvesymbolcolumnsSetcopybindrestfulJSON-Schemaes7dayjsES7styleguidefind-upvalidatesideownefficientsescliajvgradients csshookformReactiveXYAMLArray.prototype.flattentypedarrayglaciersignaleslintconfigamazonlesscssreducerwhichmonorepocloudformationes8positivebootstrap cssObject.assignstructuredClonestylesheettextparsercolourelasticachepluginformattingcorevestviewextendReactiveExtensionsdotenvjsdommobilevariablescommandcore-jsarrayfastcopycss nestingterminalpromisesyntaxsomei18ntermtypeerrorwalkingpackageendercheckeslintcolorautoprefixerbootstrap lesshttpsObject.definePropertydependenciescompile lessxhrprocessES2016fastclonerandomstreamagentUint8ArrayinspectcloudtrailgetPrototypeOfkeyspushsqschaipreserve-symlinksconcurrencyregexfast-copyECMAScript 7hasidUnderscoreidlegenericstypesafestatusreuseshareddependency managerlook-upsetlookfoldersetterFloat32Array-0characteremojiapitoArrayvisualswfchromelasteventEmittertestingmimetypeschromiumesmime-dbcss lessfigletsetImmediatemkdirpimmerfrommapreducedirloggingreducees6functionalimportexportinterruptstypescripttoolkitformatmoduleES2022entriesless compilerInt32Arraytakeregular expressionstyled-componentsbundlercolorsflattentsimmutabletestersyntaxerrorspinnerswafbuffers
1.0.0

1 year ago