Skip to content

Commit

Permalink
refactor: disable node protocol for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
schoero committed Sep 30, 2023
1 parent 832bc09 commit 392a656
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"@typescript-eslint/no-unnecessary-condition": "off"
}
},
{
"files": ["examples/**/*.js", "examples/**/*.ts"],
"rules": {
"unicorn/prefer-node-protocol": "off"
}
},
{
"env": {
"browser": true,
Expand Down
3 changes: 1 addition & 2 deletions examples/browser-bundling-with-webpack/src/pdf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "node:fs";

import BlobStream from "blob-stream";
import fs from "fs";
import PDFDocument from "pdfkit";
import Helvetica from "pdfkit/js/data/Helvetica.afm";
import HelveticaBold from "pdfkit/js/data/Helvetica-Bold.afm";
Expand Down
9 changes: 5 additions & 4 deletions examples/node-esm-javascript/src/pdf.js
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();

8 changes: 5 additions & 3 deletions examples/node-esm-javascript/src/svg.js
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());

0 comments on commit 392a656

Please sign in to comment.