npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

stimsrv-client-puppeteer

v0.0.4

Published

Server-side rendering of stimsrv tasks for old & simple browsers.

Downloads

1

Readme

stimsrv-client-puppeteer

A client for stimsrv to use with old & simple browsers. This client renders stimuli on the server using puppeteer.

This allows to incorporate old phones which cannot be updated to a modern browser, or devices with simple web browsers like e-book readers, in your experiments.

Note that user input is currently not supported with this client, so this can only be used to display stimuli.

To use stimsrv-client-puppeteer, run npm install stimsrv-client-puppeteer in your experiment directory.

You then need to create a server configuration file (e.g. stimsrv-config.js) and add the configuration for this client:

// stimsrv-config.js
const puppeteerClient = require("stimsrv-client-puppeteer");

module.exports = {
  clients: {
    "browser-simple": puppeteerClient({
      // config options go here
    })
  }
}

In your experiment definition, you need to provide the location of this server config file. You can then specify to use the puppeteer client for specific devices by adding a matching client property to those clients who should use it. The image size to deliver to the client can be configured alongside the other client properties.

// experiment.js
// ...

  serverConfigFile: "stimsrv-config.js",
  
  devices: [
    {
      id: "oldphone",
      client: "browser-simple",
      imageSize: "600x600",
      pixeldensity: 91,
      viewingdistance: 600,
    },
    // ... more devices
  ]
  
// ...

This device will then receive a simple html page with the display contents rendered as an image, instead of the fully interactive stimsrv client code.

See the simple-browser example for a fully configured example.

Headless rendering

Puppeteer can render in "headless" mode (without showing a browser window). However, graphical output in headless mode may deviate slightly from regular browsers. Therefore, headless mode is disabled by default, which means a browser window will pop up on the server when this client is used.

If you can tolerate small inconsistencies in the rendering and want to suppress the browser window, you can pass the headless option to the initializer:

// stimsrv-config.js
// ...
  clients: {
    "browser-simple": puppeteerClient({
      headless: true
    })
  }
// ...