New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jsreport/office

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsreport/office - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

13

lib/response.js

@@ -0,6 +1,4 @@

const fs = require('fs/promises')
const axios = require('axios')
const FormData = require('form-data')
const toArray = require('stream-to-array')
const { promisify } = require('util')
const toArrayAsync = promisify(toArray)

@@ -22,3 +20,3 @@ const officeDocuments = {

officeDocumentType,
stream,
filePath,
buffer,

@@ -30,3 +28,3 @@ logger

} else {
res.content = Buffer.concat(await toArrayAsync(stream))
res.content = await fs.readFile(filePath)
}

@@ -57,2 +55,4 @@

logger.debug('preparing office preview', req)
const form = new FormData()

@@ -71,3 +71,3 @@

// https://github.com/axios/axios/issues/1362 (when following redirects) in
// which the default limit is not taking into account, so we set it explicetly
// which the default limit is not taking into account, so we set it explicitly
maxContentLength: Infinity

@@ -83,2 +83,3 @@ })

message += ` (full error: ${e.message})`
logger.error(message, req)

@@ -85,0 +86,0 @@

@@ -1,11 +0,10 @@

const fs = require('fs')
const saveXmlsToOfficeFile = require('./saveXmlsToOfficeFile')
module.exports = async ({ reporter, files, officeDocumenType }, req, res) => {
module.exports = async ({ reporter, files, officeDocumentType }, req, res) => {
const {
pathToFile: officeFileName
} = await reporter.writeTempFile((uuid) => `${uuid}.${officeDocumenType}`, '')
pathToFile: officeOutputFilePath
} = await reporter.writeTempFile((uuid) => `${uuid}.${officeDocumentType}`, '')
await saveXmlsToOfficeFile({
outputPath: officeFileName,
outputPath: officeOutputFilePath,
files

@@ -15,3 +14,4 @@ })

reporter.logger.debug('Successfully zipped now.', req)
res.stream = fs.createReadStream(officeFileName)
return officeOutputFilePath
}
{
"name": "@jsreport/office",
"version": "3.0.0",
"version": "4.0.0",
"description": "Some helpers for office based jsreport recipes",
"homepage": "https://github.com/jsreport/jsreport/tree/master/packages/office#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/jsreport/jsreport.git"
},
"license": "MIT",
"author": "Jan Blaha",
"main": "index.js",

@@ -9,15 +16,12 @@ "directories": {

},
"files": [
"lib",
"index.js"
],
"scripts": {
"test": "mocha test --timeout 8000 && standard"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jsreport/jsreport.git"
},
"author": "Jan Blaha",
"license": "MIT",
"homepage": "https://github.com/jsreport/jsreport/tree/master/packages/office#readme",
"dependencies": {
"archiver": "5.3.0",
"axios": "0.23.0",
"axios": "1.6.2",
"form-data": "2.5.0",

@@ -27,3 +31,2 @@ "get-stream": "5.1.0",

"pify": "4.0.1",
"stream-to-array": "2.3.0",
"yauzl": "2.10.0",

@@ -35,8 +38,4 @@ "zip": "1.2.0"

"should": "13.2.3",
"standard": "16.0.3"
"standard": "16.0.4"
},
"files": [
"lib",
"index.js"
],
"standard": {

@@ -43,0 +42,0 @@ "env": {

@@ -8,4 +8,10 @@ # @jsreport/office

### 4.0.0
- fix asset office preview throwing error on studio
- refactor @jsreport/office to require file path instead of stream
- fix memory being held when timeouts are large
### 3.0.0-beta.1
Adaptations for the v3 APIs
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