-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: disable node protocol for examples
- Loading branch information
Showing
4 changed files
with
17 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { SwissQRBill } from "swissqrbill/pdf" | ||
import { createWriteStream } from "fs"; | ||
import PDFDocument from "pdfkit"; | ||
import { createWriteStream } from "node:fs"; | ||
import { SwissQRBill } from "swissqrbill/pdf"; | ||
|
||
import { data } from "./data.js"; | ||
|
||
const stream = createWriteStream('./swissqrbill.pdf'); | ||
|
||
const stream = createWriteStream("./swissqrbill.pdf"); | ||
const pdf = new PDFDocument({ size: "A4" }); | ||
const qrBill = new SwissQRBill(data); | ||
|
||
pdf.pipe(stream); | ||
|
||
qrBill.attachTo(pdf); | ||
pdf.end(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { SwissQRBill } from "swissqrbill/svg" | ||
import { writeFileSync } from "node:fs"; | ||
import { writeFileSync } from "fs"; | ||
import { SwissQRBill } from "swissqrbill/svg"; | ||
|
||
import { data } from "./data.js"; | ||
|
||
|
||
const qrBill = new SwissQRBill(data); | ||
writeFileSync('./swissqrbill.svg', qrBill.toString()); | ||
writeFileSync("./swissqrbill.svg", qrBill.toString()); |