Pular para o conteúdo
Skillpedia
Sites e telas (frontend)15 mil · #10922

node-lynx

O que ela faz

Dá ao assistente um runtime Lynx local para renderizar páginas, tirar capturas de tela e executar testes de fumaça. É para desenvolvedores que criam ou verificam apps Lynx.

Quando usar

  • ✓Quando você quer uma captura de tela de um pacote Lynx sem abrir um dispositivo.
  • ✓Quando você quer pré-visualizar um app Lynx em uma janela de um Mac.
  • ✓Quando você precisa de uma automação que inspecione uma página Lynx renderizada a partir de Node.js.

Link da skill

https://github.com/lynx-family/lynx/blob/develop/oliver/node-lynx/skills/node-lynx/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/lynx-family/lynx/blob/develop/oliver/node-lynx/skills/node-lynx/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Tire uma captura de tela do app de exemplo de galeria do Lynx em tamanho de celular e salve em um arquivo.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O assistente executa a ferramenta node-lynx com uma largura, uma altura e um caminho de saída. Também pode renderizar um pacote local ou usar a interface JavaScript para verificações mais profundas.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Node Lynx

Use node-lynx as a local Lynx runtime for screenshots, preview windows, smoke tests, DebugRouter OpenCard sessions, and automation that needs to inspect or interact with a rendered Lynx page from Node.js.

Default sample template URL:

https://lynxjs.org/lynx-examples/gallery/dist/GalleryComplete.lynx.bundle

CLI

Prefer the CLI for one-off screenshots, quick template validation, and simple preview sessions.

Show available options:

node-lynx --help

Capture a headless screenshot and exit:

node-lynx render \
  "https://lynxjs.org/lynx-examples/gallery/dist/GalleryComplete.lynx.bundle" \
  --width 268 \
  --height 469 \
  --dpr 2 \
  --output ./gallery.png \
  --timeout 30000 \
  --screenshot-delay 500 \
  --no-debug-router

Render a local bundle:

node-lynx render \
  --template ./dist/main/template.js \
  --width 390 \
  --height 844 \
  --output ./node-lynx-local.png \
  --no-debug-router

Open a visible preview window on macOS:

node-lynx preview \
  "https://lynxjs.org/lynx-examples/gallery/dist/GalleryComplete.lynx.bundle" \
  --width 268 \
  --height 469 \
  --dpr 2 \
  --title "Node Lynx Preview"

Start a DebugRouter-backed session without an initial template:

node-lynx render

CLI rules:

  • Use render for headless screenshots and automation.
  • Use preview only on macOS; it creates an AppKit window.
  • Use --template <path> for local bundles and --url <url> for remote bundles. A positional http:// or https:// input is treated as a remote bundle URL.
  • Use --width and --height as CSS pixel viewport values.
  • Use --dpr or --device-pixel-ratio to control output scale; the PNG pixel size is width * dpr by height * dpr.
  • Use --timeout <ms> for bundle download, template load, CDP calls, and first frame submission timeouts.
  • Use --screenshot-delay <ms> to wait after the first frame before capture. This defaults to 100; use a larger delay for image-heavy or network-heavy pages.
  • Pass --no-debug-router for CI or one-shot screenshot commands that should exit immediately after writing the PNG.
  • Omit --no-debug-router when you need DebugRouter/OpenCard. Without an initial template, render waits for DebugRouter OpenCard. preview also waits for OpenCard without creating an initial window.
  • OpenCard only loads public http(s) URLs by default. Pass --allow-any-open-card-source (API: allowAnySource: true) to load local files or a loopback/private dev server, only on a trusted network.

TypeScript API

Prefer the API when the task needs programmatic setup, repeated captures, global props, CDP calls, input simulation, or custom lifecycle handling.

Import from the node-lynx package declared by the target project. For public npm usage this is typically:

import { HeadlessLynxView } from '@lynx-js/node-lynx';

Render a remote template to PNG:

import { writeFile } from 'node:fs/promises';
import { HeadlessLynxView } from '@lynx-js/node-lynx';

const templateUrl =
  'https://lynxjs.org/lynx-examples/gallery/dist/GalleryComplete.lynx.bundle';

const view = new HeadlessLynxView({
  width: 268,
  height: 469,
  devicePixelRatio: 2,
  timeoutMs: 30000,
});

try {
  await view.loadTemplateFromUrl(templateUrl, {
    initialData: { source: 'node-lynx' },
    globalProps: { theme: 'light' },
  });
  const png = await view.screenshot({ settleMs: 500 });
  await writeFile('./gallery.png', png);
} finally {
  view.destroy();
}

Render a local bundle buffer. Always pass a file URL so relative resources have the right base URL:

import { readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { pathToFileURL } from 'node:url';
import { HeadlessLynxView } from '@lynx-js/node-lynx';

const templatePath = resolve('./dist/main/template.js');
const view = new HeadlessLynxView({ width: 390, height: 844 });

try {
  await view.loadTemplate(await readFile(templatePath), {
    url: pathToFileURL(templatePath).href,
  });
  await writeFile('./node-lynx-local.png', await view.screenshot());
} finally {
  view.destroy();
}

Inspect the DOM through CDP:

const responseText = await view.invokeCDPFromSDK(
  JSON.stringify({
    id: 1,
    method: 'DOM.getDocument',
    params: { depth: -1, pierce: true },
  })
);
const response = JSON.parse(responseText);

Update runtime data after load:

view.updateData({ selected: true 
Perguntas frequentes

Preciso de um Mac para usá-la?

Não para capturas de tela, que rodam sem interface gráfica. A janela de pré-visualização está disponível somente no macOS.

Ela consegue renderizar um app local?

Sim. Pode carregar um arquivo de template local, além de um link de pacote na web.

O que o exemplo padrão mostra?

Por padrão, carrega um pacote de exemplo de galeria do Lynx a partir do site de exemplos do Lynx.

Detalhes

Descrição original do autor

Use this skill when a task needs to run Lynx bundles with the node-lynx CLI, capture screenshots, open a macOS preview window, use DebugRouter OpenCard, inspect rendered content through CDP, or integrate node-lynx through JavaScript or TypeScript APIs.

repo: lynx-family/lynx

Popularidade

Estrelas no GitHub
15 mil
Posição no ranking
#10922
Licença
Apache-2.0
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas