Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18nexus-cli

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18nexus-cli - npm Package Compare versions

Comparing version 3.3.0 to 3.3.1

45

commands/pull.js

@@ -64,15 +64,11 @@ const fs = require('fs');

let url = usingVersion
? `https://cdn.i18nexus.com/versions/${opt.version}/translations.json`
: `${baseUrl}/project_resources/translations.json`;
url += `?api_key=${opt.apiKey}`;
console.log(`Downloading translations to ${path}...`);
const response = await handleFetch(url);
const lngResponse = await handleFetch(
`${baseUrl}/project_resources/languages.json?api_key=${opt.apiKey}`
);
if (response.status !== 200) {
if (lngResponse.status !== 200) {
return handleError(
response,
lngResponse,
usingVersion

@@ -84,4 +80,33 @@ ? 'There was a problem fetching your translations. Please ensure you are using the correct API key and a valid version number.'

const translations = await response.json();
const languageCodes = (await lngResponse.json()).collection.map(
lng => lng.full_code
);
const translations = {};
for (let index = 0; index < languageCodes.length; index++) {
const lng = languageCodes[index];
let url = usingVersion
? `https://cdn.i18nexus.com/versions/${opt.version}/translations/${lng}.json`
: `${baseUrl}/project_resources/translations/${lng}.json`;
url += `?api_key=${opt.apiKey}`;
const response = await handleFetch(url);
if (response.status !== 200) {
return handleError(
response,
usingVersion
? 'There was a problem fetching your translations. Please ensure you are using the correct API key and a valid version number.'
: 'There was a problem fetching your translations. Please try again in a moment.'
);
}
const lngTranslations = await response.json();
translations[lng] = lngTranslations;
}
if (opt.clean) {

@@ -88,0 +113,0 @@ cleanDirectory(path);

{
"name": "i18nexus-cli",
"version": "3.3.0",
"version": "3.3.1",
"description": "Command line interface (CLI) for accessing the i18nexus API",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc