mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-14 23:24:48 -04:00
🔧 use config
This commit is contained in:
parent
79f8b5f6e7
commit
cb2708c5c7
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
||||||
|
import path from "path";
|
||||||
|
import fs from "fs";
|
||||||
import puppeteer from "puppeteer";
|
import puppeteer from "puppeteer";
|
||||||
|
|
||||||
|
import { bitmapsPath } from "./config";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const browser = await puppeteer.launch({
|
const browser = await puppeteer.launch({
|
||||||
ignoreDefaultArgs: process.env.IS_LOCAL ? [" --single-process "] : [],
|
ignoreDefaultArgs: process.env.IS_LOCAL ? [" --single-process "] : [],
|
||||||
|
@ -7,7 +11,9 @@ import puppeteer from "puppeteer";
|
||||||
});
|
});
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.goto("https://google.com");
|
await page.goto("https://google.com");
|
||||||
await page.pdf({ path: "google.pdf" });
|
|
||||||
|
fs.mkdirSync(bitmapsPath);
|
||||||
|
await page.pdf({ path: path.resolve(bitmapsPath, "google.pdf") });
|
||||||
|
|
||||||
await browser.close();
|
await browser.close();
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue