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

caravaggio

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caravaggio - npm Package Compare versions

Comparing version 2.3.4 to 2.3.5

6

CHANGELOG.md
# Changelog
## 2.3.5
- Caches are faster. Now the policy is to return the cached value before saving if possible
- Fixed a bug which prevent running verbose mode in production
## 2.3.4

@@ -4,0 +10,0 @@

16

package.json
{
"name": "caravaggio",
"version": "2.3.4",
"version": "2.3.5",
"description": "A blazing fast image processor service",

@@ -38,7 +38,8 @@ "main": "index.js",

"md5": "^2.2.1",
"micro": "^9.3.0",
"micro": "^9.3.3",
"micro-redirect": "^1.0.0",
"microrouter": "^3.1.2",
"node-fetch": "^2.1.2",
"pino": "^5.4.0",
"pino": "^5.5.0",
"pino-pretty": "^2.2.0",
"sharp": "^0.20.8",

@@ -48,10 +49,9 @@ "yargs": "12.0.2"

"devDependencies": {
"eslint": "^5.4.0",
"eslint": "^5.6.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-import-resolver-jest": "^2.1.1",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jest": "^21.15.1",
"jest": "^23.5.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^21.22.0",
"jest": "^23.6.0",
"micro-dev": "3.0.0",
"pino-pretty": "^2.0.1",
"request-promise": "^4.2.2",

@@ -58,0 +58,0 @@ "test-listen": "^1.1.0"

const fs = require('fs-extra');
const os = require('os');
const path = require('path');
const logger = require('../logger');

@@ -32,10 +33,15 @@ const DEFAULT_TEMP_DIR = os.tmpdir();

save: (filename, buffer) => fs
.outputFile(getCompleteFilename(filename), buffer, { encoding: null })
.then(() => ({
save: async (filename, buffer) => {
const completeFilename = getCompleteFilename(filename);
fs.outputFile(completeFilename, buffer, { encoding: null })
.catch((e) => {
logger.error(e, `File persistor failed to save file ${completeFilename}`);
});
return {
type: 'buffer',
buffer,
})),
};
},
};
};

@@ -26,11 +26,10 @@

module.exports = ({ limit } = { limit: 100 }) => ({
flush: () => {
flush: async () => {
persisted.files = {};
persisted.size = 0;
return Promise.resolve();
},
exists: filename => Promise.resolve(!!persisted.files[filename]),
exists: async filename => !!persisted.files[filename],
read: filename => Promise.resolve(persisted.files[filename]
read: async filename => (persisted.files[filename]
? {

@@ -42,12 +41,11 @@ type: 'buffer',

save: (filename, buffer) => {
save: async (filename, buffer) => {
persisted.files[filename] = buffer;
increaseSize(buffer.length);
checkMemory(limit, filename);
return Promise.resolve({
return {
type: 'buffer',
buffer,
});
};
},
});
module.exports = () => ({
exists: Promise.resolve(false),
exists: async () => false,
read: () => Promise.resolve(null),
read: async () => null,
save: (filename, buffer) => Promise.resolve({
save: async (filename, buffer) => ({
type: 'buffer',

@@ -8,0 +8,0 @@ buffer,

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