You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

astro-selfie

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-selfie - npm Package Compare versions

Comparing version

to
1.0.2

7

dist/index.js

@@ -9,3 +9,2 @@ import path from 'node:path';

import { chromium } from 'playwright';
import makeDir from 'make-dir';
export default function selfie() {

@@ -23,3 +22,3 @@ let publicDir;

const screenshotsDir = new URL('og', publicDir);
await makeDir(fileURLToPath(screenshotsDir));
await fs.mkdir(fileURLToPath(screenshotsDir), { recursive: true });
const port = await getPort();

@@ -48,6 +47,6 @@ const baseUrl = new URL(`http://localhost:${port}`);

await page.goto(url.href);
await page.evaluate('document.body.setAttribute("data-astro-selfie", "true")');
await page.evaluate('document.body.dataset.astroSelfie = true;');
const screenshot = await page.screenshot({ type: 'png' });
const screenshotPath = path.join(fileURLToPath(screenshotsDir), pathname === '' ? 'index.png' : `${pathname}.png`);
await makeDir(path.dirname(screenshotPath));
await fs.mkdir(path.dirname(screenshotPath), { recursive: true });
await fs.writeFile(screenshotPath, screenshot);

@@ -54,0 +53,0 @@ }

{
"name": "astro-selfie",
"version": "1.0.1",
"version": "1.0.2",
"description": "Astro integration to generate page screenshots to show as Open Graph images",

@@ -34,3 +34,2 @@ "license": "ISC",

"get-port": "^7.0.0",
"make-dir": "^3.1.0",
"micro": "^10.0.1",

@@ -37,0 +36,0 @@ "playwright": "^1.34.3",

@@ -51,6 +51,4 @@ # astro-selfie [![test](https://github.com/vadimdemedes/astro-selfie/actions/workflows/test.yml/badge.svg)](https://github.com/vadimdemedes/astro-selfie/actions/workflows/test.yml)

---
<meta
property="og:image"
content={screenshotUrl.href}
/>
<meta property="og:image" content={screenshotUrl.href} />
```

@@ -57,0 +55,0 @@