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

@vestfoldfylke/pdf-text-extract

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vestfoldfylke/pdf-text-extract - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

8

index.js

@@ -1,2 +0,6 @@

const pdfjsLib = require('pdfjs-dist/legacy/build/pdf.js')
const getPdfDocument = async (pdf) => {
const { getDocument } = await import('pdfjs-dist/legacy/build/pdf.min.mjs')
return await getDocument(pdf)
}
// Need the legacy build to work with Node - newer versions require Canvas to work, we don't want it

@@ -50,3 +54,3 @@

}
const loadingTask = await pdfjsLib.getDocument(pdf)
const loadingTask = await getPdfDocument(pdf)
const doc = await loadingTask.promise

@@ -53,0 +57,0 @@ pdfData.metadata = await doc.getMetadata()

{
"name": "@vestfoldfylke/pdf-text-extract",
"description": "Node module that extracts metadata, text-content, and styling from readable pdf-files",
"version": "1.0.0",
"version": "2.0.0",
"main": "index.js",

@@ -28,3 +28,3 @@ "scripts": {

"dependencies": {
"pdfjs-dist": "2.16.105"
"pdfjs-dist": "^4.2.67"
},

@@ -34,2 +34,2 @@ "devDependencies": {

}
}
}

@@ -17,3 +17,2 @@ # pdf-text-extract

const pdf = 'https://<url-to-pdf>.pdf' // Network resource. Remember to handle CORS if using url
const pdf = readFileSync('./<path-to-pdf>.pdf') // Buffer (doesnt have to come from readFile - just as an example)
const pdf = new Uint8Array(readFileSync('./<path-to-pdf>.pdf')) // Uint8Array (doesnt have to come from readFile - just as an example)

@@ -20,0 +19,0 @@ const pdf = { url: './<path-or url-to-pdf>.pdf', data: 'arrayBuffer or similar', verbosity: 0, ...options } // use either url or data - options are found in typedef, verboosity: 0 for suppressing logs

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