🧹 Cleanup

This commit is contained in:
KaizIqbal 2020-07-25 17:10:30 +05:30
parent fa8de2813f
commit 3919925cfa

View file

@ -1,20 +1,3 @@
import path from "path";
import fs from "fs";
import puppeteer from "puppeteer";
import { bitmapsDir, svgs } from "./config";
import { bitmapsPath } from "./config";
(async () => {
const browser = await puppeteer.launch({
ignoreDefaultArgs: process.env.IS_LOCAL ? [" --single-process "] : [],
headless: true,
});
const page = await browser.newPage();
await page.goto("https://example.com");
if (!fs.existsSync(bitmapsPath)) fs.mkdirSync(bitmapsPath);
await page.pdf({ path: path.resolve(bitmapsPath, "google.pdf") });
await browser.close();
})();
console.log(bitmapsDir, svgs);