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

@pipedream/browsers

v1.0.3

Published

For using puppeeter or playwright in Pipedream Node.js Code Steps. Includes the prebuilt binaries and specific versions for compatiblity with Pipedream.

Downloads

643

Readme

@pipedream/browsers package

This package abstracts the exact version pinning required for puppeteer & playwright to function properly in Pipedream code steps.

The index.mjs file reexports the specific pinned versions of puppeeter-core & playwright that are compatible with the same chromium version that is compatible with Lambda.

The reason this package is required is because NPM package versions can't be pinned in both playwright.app.mjs as an in-JS pin and pin over the playwright/package.json.

Therefore, it's not possible to offer both the pinned versions of chromium & playwright in both pre-built actions & in Node.js code steps.

Usage

This package exports two modules: puppeteer & playwright. Both modules share the same interface:

  • browser(opts?) - method to instantiate a new browser (returns a browser instance)
  • launch(opts?) - an alias to browser()
  • newPage() - creates a new page instance and returns both the page & browser

Note: After awaiting the browser instance with either puppeteer or playwright, make sure to close the browser at the end of your Node.js code step.

Puppeteer

import { puppeteer } from '@pipedream/browsers';

export default defineComponent({
  async run({steps, $}) {
    const browser = await puppeteer.browser();
    
    console.log(browser)
    // get page, perform actions, etc.

    await browser.close();
  },
})

Playwright

import { playwright } from '@pipedream/browsers';

export default defineComponent({
  async run({steps, $}) {
    const browser = await puppeteer.browser();
    const page = await browser.newPage();

    page.goto('https://pipedream.com');
    const title = await page.title()


    // Puppeteer requires you to close page context's before closing the browser itself
    // otherwise, the code step's execution will hang
    await page.context().close();
    await browser.close();
  },
})

Additional Resources

  • Compatibility Table for Chromium <> Puppeteer version support here: https://pptr.dev/chromium-support
  • Compatibility Table for Chromium <> Playwright versions can be found here: https://www.browserstack.com/docs/automate/playwright/browsers-and-os

The reason why playwright is locked to an old version is because the latest Puppeeter Chromium version that works in a code step is chromium@121.