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

@pdfme/generator

Package Overview
Dependencies
Maintainers
1
Versions
269
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pdfme/generator - npm Package Compare versions

Comparing version 1.0.18 to 1.1.0

dist/cjs/__tests__/assets/templates/index.js

30

package.json
{
"name": "@pdfme/generator",
"version": "1.0.18",
"version": "1.1.0",
"sideEffects": false,
"author": "hand-dot",

@@ -23,5 +24,11 @@ "license": "MIT",

},
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/types/index.d.ts",
"main": "dist/cjs/src/index.js",
"module": "dist/esm/src/index.js",
"types": "dist/types/src/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/src/index.js",
"require": "./dist/cjs/src/index.js"
}
},
"engines": {

@@ -31,4 +38,6 @@ "node": ">=14"

"scripts": {
"develop": "webpack --watch --mode development",
"build": "NODE_ENV=production webpack --mode production",
"develop": "tsc -w",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"clean": "rimraf dist",

@@ -45,3 +54,3 @@ "lint": "tsc --noEmit",

"atob": "^2.1.2",
"bwip-js": "^2.1.3",
"bwip-js": "^3.2.2",
"pdf-lib": "^1.17.1"

@@ -53,3 +62,2 @@ },

"jsqr": "^1.4.0",
"node-polyfill-webpack-plugin": "^1.1.4",
"pdf2json": "^2.0.0",

@@ -59,5 +67,3 @@ "pngjs": "^6.0.0"

"jest": {
"moduleNameMapper": {
"\\.(ttf)$": "<rootDir>/../../fontTransformer.js"
},
"resolver": "ts-jest-resolver",
"moduleFileExtensions": [

@@ -72,3 +78,3 @@ "js",

"ts-jest": {
"tsconfig": "tsconfig.json"
"tsconfig": "tsconfig.esm.json"
}

@@ -75,0 +81,0 @@ },

4

src/generate.ts

@@ -11,4 +11,4 @@ import { PDFDocument } from 'pdf-lib';

InputImageCache,
} from './helper';
import { TOOL_NAME } from './constants';
} from './helper.js';
import { TOOL_NAME } from './constants.js';

@@ -15,0 +15,0 @@ const preprocessing = async (arg: {

@@ -12,5 +12,3 @@ import {

} from 'pdf-lib';
import { ToBufferOptions } from 'bwip-js';
import bwipjsNode from 'bwip-js/dist/node-bwipjs';
import bwipjsBrowser from 'bwip-js/dist/bwip-js';
import bwipjs, { ToBufferOptions } from 'bwip-js';
import {

@@ -64,7 +62,7 @@ getB64BasePdf,

const canvas = document.createElement('canvas');
bwipjsBrowser.toCanvas(canvas, bwipjsArg);
bwipjs.toCanvas(canvas, bwipjsArg);
const dataUrl = canvas.toDataURL('image/png');
res = b64toUint8Array(dataUrl).buffer as Buffer;
} else {
res = await bwipjsNode.toBuffer(bwipjsArg);
res = await bwipjs.toBuffer(bwipjsArg);
}

@@ -71,0 +69,0 @@

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

import generate from './generate';
import generate from './generate.js';

@@ -3,0 +3,0 @@ export { generate };

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