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

0.0.3 • Public • Published

Cairn


    //   ) )                              
   //         ___     ( )  __       __    
  //        //   ) ) / / //  ) ) //   ) ) 
 //        //   / / / / //      //   / /  
((____/ / ((___( ( / / //      //   / /   

Cairn is an npm package and CLI tool for saving the web page as a single HTML file. It is a Node.js version Obelisk implement in TypeScript.

Features

Usage

As npm package

npm install @wabarc/cairn
import { Cairn } from '@wabarc/cairn';
 
const cairn = new Cairn();
 
cairn
  .request({ url: url })
  .options({ userAgent: 'Cairn/1.0.0' })
  .archive()
  .then((webpage) => {
    console.log(url, webpage);
  })
  .catch((err) => console.warn(`${url} => ${JSON.stringify(err)}`));

As CLI tool

npm install -g @wabarc/cairn
$ cairn -h
 
Usage: cairn [options] url1 [url2]...[urlN]
 
CLI tool for saving web page as single HTML file
 
Options:
  -v, --version              output the current version
  -o, --output <string>      path to save archival result
  -u, --user-agent <string>  set custom user agent
  --no-js                    disable JavaScript
  --no-css                   disable CSS styling
  --no-embeds                remove embedded elements (e.g iframe)
  --no-medias                remove media elements (e.g img, audio)
  -h, --help                 display help for command

License

This software is released under the terms of the GNU General Public License v3.0. See the LICENSE file for details.

Package Sidebar

Install

npm i jokkerr

Weekly Downloads

0

Version

0.0.3

License

GPL-3.0-or-later

Unpacked Size

83.4 kB

Total Files

27

Last publish

Collaborators

  • jokkerr