0.8.0 • Published 10 months ago

collapsify v0.8.0

Weekly downloads
21
License
MIT
Repository
github
Last release
10 months ago

Collapsify npm.io npm.io

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.

0.8.0

10 months ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.6

10 years ago

0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago