![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@qrcode-js/node
Advanced tools
This is a wrapper around the core package, enabling creation of QRs on the server side, on Node environments.
Behind the scenes it uses the canvas
package to use the canvas like the built-in in browsers.
import QRCodeNode from "@qrcode-js/node";
import { promises as fs } from "fs";
async function main() {
const myQR = QRCodeNode({
text: "https://github.com/qrcode-js/qrcode",
colorDark: "#123456",
size: 1000,
logo: { round: 0.4, margin: 0 },
dots: {
scale: 0.75,
round: 1,
},
finder: {
round: 0.5,
},
gradient: (ctx, size) => {
const gradient = ctx.createLinearGradient(0, 0, size, 0);
gradient.addColorStop(0, "green");
gradient.addColorStop(0.5, "grey");
gradient.addColorStop(1, "red");
return gradient;
},
drawFunction: "telegram",
// drawFunction: (
// canvasContext,
// left,
// top,
// nSize,
// scale,
// round,
// parameters,
// otherCells
// ) => {
// if (parameters.isTiming) {
// AwesomeQR._drawDot(canvasContext, left, top, nSize, scale, round);
// }
// },
});
await fs.mkdir("dist", { recursive: true });
await myQR.draw().then((d) => fs.writeFile("dist/qrcode.png", d));
}
main().catch(console.error);
This package ships with a CLI, a Command Line Interface.
Usage: npx qrcode [OPTIONS] path/to/output-file
Options are two, --help
and --opt
.
--help
will show a help message and exit.
--opt
is used to set individual options for the QR.
To use this you have to separate key and value by a =
char.
Numbers are automatically parsed. To set a nested parameter use the "dot" syntax by Lodash (internally it's used). See example below to better understand.
npx qrcode --opt text="This is a text" --opt size=1000 --opt dots.round=0.5 ./qrcode.png
FAQs
NodeJs version of the Awesome QR
The npm package @qrcode-js/node receives a total of 3 weekly downloads. As such, @qrcode-js/node popularity was classified as not popular.
We found that @qrcode-js/node demonstrated a not healthy version release cadence and project activity because the last version was released 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.