This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

collapsify
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

Collapsify

Inlines all of the JavaScripts, stylesheets, images, fonts etc. of an HTML page.

Installation

npm install -g collapsify

Usage

You can use the collapsify CLI like this to download and save the page into a single file like this:

collapsify -o single-page.html https://my-site.com/

see collapsify -h for all options.

API

import {simpleCollapsify} from 'collapsify';

await simpleCollapsify('https://example.com', {
  headers: {
    'accept-language': 'en-US'
  }
})
  .then(page => console.log(page))
  .catch(err => console.error(err));

The simpleCollapsify function takes the URL to collapse, as well as an object of options, and returns a promise that resolves to a String.

Options

  • headers: An object of headers, to be added to each HTTP request.
  • forbidden: A regex that matches blacklisted resources that should be avoided while navigating.

Requirements

The simple mode and CLI require nodejs >= 18, as they use the global fetch function.

Package Sidebar

Install

npm i collapsify

Weekly Downloads

15

Version

0.8.0

License

MIT

Unpacked Size

25.1 kB

Total Files

40

Last publish

Collaborators

  • lbarthonet
  • cf-media-manager
  • jacobbednarz
  • celso
  • cf-radar
  • dash_service_account
  • g4brym
  • snigdha34
  • wrangler-publisher
  • marksteyn
  • chiminator
  • sgoodhew_cf
  • terinjokes
  • third774
  • jsteinberger
  • jasnell
  • asapzacy
  • pcostanzo
  • gregbrimble
  • geelen
  • rexscaria
  • dcruz_cf
  • xuranwang
  • jculvey
  • sejoker
  • vasturiano
  • cf-ci-write
  • segments-write
  • thibmeu
  • xortive
  • gurjinder
  • cf-ci2
  • lvalenta
  • worenga
  • cdata