1.1.0 • Published 3 years ago

last-redirect v1.1.0

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

last-redirect

A shortcut function to return summary details of last URL redirect in a chain.

For use with the Puppeteer Node library for Chromium web browser automation.

Usage

Incorporate the function into a Puppeteer script. E.g.

const puppeteer = require('puppeteer');
const lastRedirect = require('last-redirect');

(async () => {
  const browser = await puppeteer.launch({});
  const page = await browser.newPage()
  const res = await page.goto('http://www.google.com', { waitUntil: 'networkidle2' })
  console.log(lastRedirect(res));
  await browser.close()
})()

Expected result

{ count: 1, status: 302, statusText: 'Found' }
1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago