Skip to main content
Home

Built and signed on GitHub Actions

A lightweight development web server.

This package works with Deno
This package works with Deno
JSR Score
100%
Published
4 months ago (0.10.2)
class Playground

Manage the playground page.

Examples

Basic usage

await Playground.test('Test', async (t) => {
  await t.step('create button', () => {
    Playground.preview.set('<button>button</button>');
    Playground.log(Playground.preview.get('button').textContent);
    Playground.log(Playground.preview.get().innerHTML);
  });
});

Static Properties

PlaygroundCode instance that manipulate the code.

PlaygroundLogs instance that manipulate the logs.

PlaygroundPreview instance that manipulate the preview content.

Static Methods

log(...data: Array<unknown>): void

Adds a new log.

This is an alias for Playground.logs.add().

sleep(ms: number): Promise<void>

Pauses execution for a specified amount of time.

test(
name: string,
fn: (context: PlaygroundTestContext) => unknown,
): Promise<boolean>

Runs a test.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@akiraohgaki/devsrv

Import symbol

import { Playground } from "@akiraohgaki/devsrv/playground";
or

Import directly with a jsr specifier

import { Playground } from "jsr:@akiraohgaki/devsrv/playground";