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

jspdf-barcode

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jspdf-barcode - npm Package Compare versions

Comparing version 0.1.8 to 1.0.0

dist/index.esm.js

15

package.json
{
"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",

14

README.md

@@ -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'],
},
};
];
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