jspdf-barcode
Advanced tools
Comparing version 0.1.8 to 1.0.0
{ | ||
"name": "jspdf-barcode", | ||
"version": "0.1.8", | ||
"version": "1.0.0", | ||
"description": "barcode generator plugin for jspdf", | ||
@@ -8,7 +8,7 @@ "main": "dist/jspdf-barcode.js", | ||
"exports": { | ||
"import": "./dist/jspdf-barcode.js", | ||
"require": "./dist/jspdf-barcode.cjs" | ||
"import": "./dist/index.esm.js", | ||
"require": "./dist/index.umd.js" | ||
}, | ||
"scripts": { | ||
"build": "webpack --mode production", | ||
"build": "node --openssl-legacy-provider ./node_modules/webpack/bin/webpack.js && webpack --mode production", | ||
"build-example": "npm run build --workspace=example && npm run build --workspace=example-server-side", | ||
@@ -32,4 +32,7 @@ "example": "npm run dev --workspace=example", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"jspdf": ">=2.0.0" | ||
}, | ||
"dependencies": { | ||
"jspdf": "^2.5.1" | ||
"code-128-encoder": "^3.1.1" | ||
}, | ||
@@ -39,6 +42,6 @@ "devDependencies": { | ||
"@rollup/plugin-typescript": "^5.0.2", | ||
"@types/node": "^14.17.34", | ||
"@typescript-eslint/eslint-plugin": "^3.6.1", | ||
"@typescript-eslint/parser": "^3.6.1", | ||
"babel-loader": "^8.2.2", | ||
"code-128-encoder": "^3.1.1", | ||
"ts-loader": "^8.0.0", | ||
@@ -45,0 +48,0 @@ "typescript": "^3.9.6", |
@@ -18,2 +18,4 @@ # Demo | ||
require jspdf >= 2.0.0 | ||
### ES6 | ||
@@ -23,6 +25,6 @@ | ||
import jsPDF from "jspdf"; // please use default import | ||
import "jspdf-barcode"; | ||
import jspdfBarcode from "jspdf-barcode"; | ||
const doc = new jsPDF() | ||
doc.barcode("barcodeValue", { | ||
jspdfBarcode(doc, "barcodeValue", { | ||
fontSize: 23, | ||
@@ -34,3 +36,2 @@ textColor: "#000000", | ||
}) | ||
doc.setFont("Courier"); // reset font to your font | ||
``` | ||
@@ -42,6 +43,6 @@ | ||
const { jsPDF } = require("jspdf") | ||
require("jspdf-barcode") | ||
const jspdfBarcode = require("jspdf-barcode").default // use .default | ||
const doc = new jsPDF() | ||
doc.barcode("barcodeValue", { | ||
jspdfBarcode(doc, "barcodeValue", { | ||
fontSize: 23, | ||
@@ -53,3 +54,2 @@ textColor: "#000000", | ||
}) | ||
doc.setFont("Courier"); // reset font to your font | ||
``` | ||
@@ -64,3 +64,5 @@ | ||
|--------------|--------|------------------------------------------------------------------------------------------------------------| | ||
| doc | string | jspdf instance | | ||
| barcodeValue | string | alphanumeric | | | | ||
| options | object | `fontSize` number, <br/> `textColor` string, <br/> `x`: number // x coordinate of pdf, <br/> `y`: number // y coordinate of pdf, <br/> [textOptions(optional)](https://artskydj.github.io/jsPDF/docs/jsPDF.html#text) | | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"baseUrl": ".", | ||
@@ -18,7 +17,7 @@ "target": "ESNext", | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "react-jsx", | ||
"declaration": true, | ||
"declarationDir": "./", | ||
}, | ||
"include": ["src", "dist", "example", "types.d.ts"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
"include": ["src/*"], | ||
"exclude": ["**/*.test.ts", "*/code-128-font.ts"] | ||
} |
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"module": "ESNext", | ||
@@ -5,0 +4,0 @@ "moduleResolution": "Node", |
const path = require('path'); | ||
module.exports = { | ||
mode: 'production', | ||
entry: './src/index.js', | ||
output: { | ||
path: path.resolve('dist'), | ||
filename: 'index.js', | ||
libraryTarget: 'commonjs2', | ||
module.exports = [ | ||
{ | ||
// UMD build configuration (CommonJS and Global compatible) | ||
mode: 'production', | ||
entry: './src/index.ts', // Entry point for TypeScript | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), // Output directory | ||
filename: 'index.umd.js', // UMD output filename | ||
library: { | ||
type: 'umd', // UMD format | ||
}, | ||
globalObject: 'this', // Compatibility for Node.js and browsers | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, // Handle TypeScript files (.ts only) | ||
exclude: /node_modules/, | ||
use: 'ts-loader', // Use ts-loader for TypeScript files | ||
}, | ||
{ | ||
test: /\.js$/, // Handle JavaScript files | ||
exclude: /node_modules/, | ||
use: 'babel-loader', | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js'], // Resolve .ts and .js extensions | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.js?$/, | ||
exclude: /(node_modules)/, | ||
use: 'babel-loader', | ||
{ | ||
// ES Module build configuration (For modern environments using `import`) | ||
mode: 'production', | ||
entry: './src/index.ts', // Entry point for TypeScript | ||
output: { | ||
path: path.resolve(__dirname, 'dist'), // Output directory | ||
filename: 'index.esm.js', // ES Module output filename | ||
library: { | ||
type: 'module', // ES Module format | ||
}, | ||
], | ||
}, | ||
experiments: { | ||
outputModule: true, // Enable ES module output | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, // Handle TypeScript files (.ts only) | ||
exclude: /node_modules/, | ||
use: 'ts-loader', // Use ts-loader for TypeScript files | ||
}, | ||
{ | ||
test: /\.js$/, // Handle JavaScript files | ||
exclude: /node_modules/, | ||
use: 'babel-loader', | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js'], // Resolve .ts and .js extensions | ||
}, | ||
}, | ||
resolve: { | ||
extensions: ['.js'], | ||
}, | ||
}; | ||
]; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
63
0
53760
2
9
104
1
+ Addedcode-128-encoder@^3.1.1
+ Addedcode-128-encoder@3.1.1(transitive)
- Removedjspdf@^2.5.1