{"id":18620535,"url":"https://github.com/thibmaek/loco-api-js","last_synced_at":"2025-04-11T02:31:13.318Z","repository":{"id":48862097,"uuid":"165875344","full_name":"thibmaek/loco-api-js","owner":"thibmaek","description":"🌏 Javascript API wrapper for Loco translation system's REST API","archived":false,"fork":false,"pushed_at":"2021-07-08T11:41:59.000Z","size":248,"stargazers_count":7,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T15:53:27.590Z","etag":null,"topics":["api","esm","i18n","loco","loco-js","loco-rest-api","microbundle","node","npm","translation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thibmaek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-15T15:28:40.000Z","updated_at":"2023-12-02T23:27:00.000Z","dependencies_parsed_at":"2022-09-03T14:20:57.883Z","dependency_job_id":null,"html_url":"https://github.com/thibmaek/loco-api-js","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibmaek%2Floco-api-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibmaek%2Floco-api-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibmaek%2Floco-api-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibmaek%2Floco-api-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibmaek","download_url":"https://codeload.github.com/thibmaek/loco-api-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248329557,"owners_count":21085559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","esm","i18n","loco","loco-js","loco-rest-api","microbundle","node","npm","translation"],"created_at":"2024-11-07T04:06:53.021Z","updated_at":"2025-04-11T02:31:09.489Z","avatar_url":"https://github.com/thibmaek.png","language":"JavaScript","readme":"# loco-api-js\n\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg)](https://github.com/RichardLitt/standard-readme)\n[![latest-release](https://badgen.net/github/release/thibmaek/loco-api-js)](https://github.com/thibmaek/loco-api-js)\n[![license](https://badgen.net/github/license/thibmaek/loco-api-js)](https://github.com/thibmaek/loco-api-js/LICENSE)\n[![npm-latest](https://badgen.net/npm/v/loco-api-js)](https://www.npmjs.com/package/loco-api-js)\n[![size-cjs](https://badgen.net/badgesize/normal/https://unpkg.com/loco-api-js/dist/index.js)](https://unpkg.com/loco-api-js/dist/index.js)\n[![size-es](https://badgen.net/badgesize/normal/https://unpkg.com/loco-api-js/dist/index.es.js)](https://unpkg.com/loco-api-js/dist/index.es.js)\n\n\u003e Javascript API wrapper for Loco translation system\u0026#39;s REST API\n\nConvenience API wrapper around the [Loco](https://localise.biz) REST API, written in modern Javascript.\nModules are provided as CommonJS, UMD and ESM.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n```console\nnpm i loco-api-js\nyarn add loco-api-js\n```\n\n## Usage\n\nSee and run [example.js](https://github.com/thibmaek/loco-api-js/example.js) or [try it out in a REPL](https://repl.it/@thibmaek/node-loco-api-js-demo)\n\n```js\n// ESM (Bundlers, Modern engines)\nimport LocoClient from 'loco-api-js';\n\n// CJS (Node)\nconst LocoClient = require('loco-api-js');\n\nconst loco = new LocoClient('\u003cyour-api-key\u003e');\n\n(async () =\u003e {\n  console.log(await loco.getAssets());\n  console.log(await loco.getAsset('some.asset.path'));\n  console.log(await loco.getAsset(['some', 'asset', 'path']));\n  console.log(await loco.getAssetsByTags(['1.5.0']));\n  console.log(await loco.getTranslation('some.asset.path', 'en'));\n  console.log(await loco.exportToFile({\n    tags: ['production'],\n    withoutTags: ['unused'],\n  }));\n  console.log(await loco.exportArchive({\n    tags: ['production'],\n    withoutTags: ['unused'],\n  }));\n})();\n```\n\n## API\n\n### LocoClient\n\n_These options can be provided in an object as a second argument when creating the client to interact with._\n\n| Option              | Type      | Requirement  | Description                                                             | Default             |\n| ------------------- | --------- | ------------ | ----------------------------------------------------------------------- | ------------------- |\n| fileName            | `string`  | **Optional** | When provided, methods that export a file (JSON/ZIP) will use this name | `loco-locales`      |\n| debug               | `boolean` | **Optional** | Will be more verbose in output and show for example the API req. URL    | `false`             |\n\n### Client.exportToFile, Client.exportArchive\n\n_Provide as an object to the methods that export a file._\n\n| Option      | Type            | Requirement  | Description                                     | Default     |\n| ----------- | --------------- | ------------ | ----------------------------------------------- | ----------- |\n| tags        | `Array\u003cstring\u003e` | **Optional** | Only assets with these tags will be included    | `undefined` |\n| withoutTags | `Array\u003cstring\u003e` | **Optional** | Assets that carry this tag will not be included | `undefined` |\n\n## Maintainers\n\n[@thibmaek](https://github.com/thibmaek)\n\n## Contributing\n\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nMIT © 2019 - current Thibault Maekelbergh\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibmaek%2Floco-api-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibmaek%2Floco-api-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibmaek%2Floco-api-js/lists"}