Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
QR Code generator for browser and node.js with tree shaking and logo support
QR Code generator for browser and node.js with tree shaking and logo support
png
, svg
and pdf
formatsnpm install qreate
# or
yarn add qreate
Example:
import { getSVG } from "qreate/lib/svg";
import { getPNG } from "qreate/lib/png"; // imports canvas implementation in browser and sharp module in node.js
import { getPDF } from "qreate/lib/pdf"; // this import is large, consider async import
const svgString = await getSVG("I love QR", {
logo: fs.openFileSync("my-logo.svg"),
color: "#000000",
bgColor: "#FFFFFF",
});
const pngBuffer = await getPNG("I love QR", {
logo: fs.openFileSync("my-logo.svg"),
color: "rgb(0, 0, 0)",
bgColor: "rgb(255, 255, 255)",
});
getPNG(text, [options])
: Readable stream with image data.getSVG(text, [options])
: Readable stream with image data.getPDF(text, [options])
: Readable stream with image data.text
: text to encodeoptions
: additional image options objectName | Description | Type | Possible Values | Default |
---|---|---|---|---|
ec_level | error correction level | string | L , M , Q , H | M |
type | image type | string | png , svg , pdf | png |
size | png and svg only size of one module in pixels | number | 0 - n | 5 (png)0 (others) |
margin | white space around QR image in modules | number | 0 - n | 4 (png)1 (others) |
parse_url | EXPERIMENTAL try to optimize QR-code for URLs | boolean | true , false | false |
logo | buffer with png/jpeg image | ArrayBuffer | - | undefined |
logoWidth | height of logo in percent | number | 0 - 100 | 20 |
logoHeight | width of logo in percent | number | 0 - 100 | 20 |
color | module color in rgba or hex format | number | #000000 - #000000 | #000000 (black with 100% opacity) |
bgColor | background color in rgba or hex format | number | #000000 - #FFFFFF | #FFFFFF (white with 100% opacity) |
borderRadius | border-radius (in pixels) | number | 0 - size / 2 | 0 |
getPNG x 229 ops/sec ±0.45% (84 runs sampled)
getPDF x 186 ops/sec ±24.91% (86 runs sampled)
getSVG x 2,482 ops/sec ±0.18% (90 runs sampled)
getPNG with logo x 69.96 ops/sec ±0.72% (68 runs sampled)
getPDF with logo x 44.83 ops/sec ±9.52% (77 runs sampled)
getSVG with logo x 2,494 ops/sec ±0.19% (88 runs sampled)
FAQs
QR Code generator for browser and node.js with tree shaking and logo support
The npm package qreate receives a total of 2 weekly downloads. As such, qreate popularity was classified as not popular.
We found that qreate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.