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

crowdin-api

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crowdin-api - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

38

index.js

@@ -51,2 +51,6 @@ 'use strict';

const out = fs.createWriteStream(null, {
fd
});
return new Bluebird((resolve, reject) => {

@@ -57,3 +61,3 @@ let statusCode;

.on('error', err => {
reject(parseError(err));
return reject(parseError(err));
})

@@ -63,18 +67,28 @@ .on('response', response => {

})
.on('close', async () => {
if (statusCode < 400) {
resolve(path);
} else {
.pipe(out);
out.on('close', async () => {
if (statusCode < 400) {
return resolve(path);
} else {
try {
let body = await Bluebird.fromCallback(cb => fs.readFile(path, {
encoding: 'utf8'
}, cb));
try {
const result = await Bluebird.fromCallback(cb => fs.readFile(path, 'utf8'));
const result = JSON.parse(body);
reject(resultToError(result));
return reject(resultToError(result));
} catch (err) {
reject(`Error streaming from Crowdin: ${statusCode}`);
console.log('Error parsing body', err);
console.log(body);
}
} catch (err) {
console.log('Error reading body file', err);
}
})
.pipe(fs.createWriteStream(null, {
fd
}));
return reject(`Error streaming from Crowdin: ${statusCode}`);
}
});
});

@@ -81,0 +95,0 @@ }

{
"name": "crowdin-api",
"version": "2.0.0",
"version": "2.0.1",
"description": "API client for Crowdin",

@@ -5,0 +5,0 @@ "repository": {

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