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

    0.7.2 • Public • Published

    Collapsify Build Status

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

    Installation

    npm install -g collapsify

    Usage

    An HTTP server is installed as collapsify-server, which collapses the URL passed to “/?url=”. This HTTP server is systemd-aware: when running as a systemd service, collapsify will listen on the socket passed. Otherwise, this server defaults to listening on port 8020, which can be changed via the “-p” flag.

    Additional options can by found via the built in usage information, collapsify-server -h.

    API

    var collapsify = require('collapsify');
    
    collapsify('http://www.cloudflare.com', {
      headers: {
        Accept-Language: 'en-US'
      },
    }).then(function(output) {
      console.log(output);
    });

    The “collapsify” function takes the URL to collapse, as well as an object of options, and returns a promise that resolves to a Buffer.

    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.

    Install

    npm i collapsify

    DownloadsWeekly Downloads

    500

    Version

    0.7.2

    License

    MIT

    Unpacked Size

    29.8 kB

    Total Files

    42

    Last publish

    Collaborators

    • trevorcf
    • g4brym
    • snigdha34
    • wrangler-publisher
    • marksteyn
    • chiminator
    • sgoodhew_cf
    • terinjokes
    • third774
    • evanderkoogh
    • jsteinberger
    • jasnell
    • kkoenig
    • asapzacy
    • pcostanzo
    • gregbrimble
    • geelen
    • jgentes
    • rexscaria
    • dcruz_cf
    • xuranwang
    • jculvey
    • sejoker
    • caass
    • vasturiano
    • cf-ci-write
    • segments-write
    • thibmeu
    • xortive
    • gurjinder
    • cf-ci2
    • lvalenta
    • worenga
    • cdata