Html Screen Capture Js

screenshot of Html Screen Capture Js

A tiny, highly-customizable, single-function javascript/typescript library that captures a webpage and returns a new lightweight, self-contained HTML document. The library removes all external file dependencies while preserving the original appearance of the page. At only 12KB, it offers unparall...

Overview

If you're looking to capture webpages effortlessly while maintaining their original look and feel, this tiny JavaScript/TypeScript library offers a robust solution. At a mere 12KB, it excels in performance and reliability, stripping away dependencies and returning a fully self-contained HTML document. It’s designed for anyone needing to create snapshots of webpages for various purposes, from compliance documentation to archiving.

This library stands out as an efficient tool for developers and web enthusiasts alike. Whether you wish to save a complete page or send its content to a remote server, its straightforward functionality and customizability make it a valuable addition to your toolkit.

Features

  • Lightweight and Fast: At just 12KB, the library is efficient for quick screen captures without compromising performance.
  • Self-Contained Capture: It generates a single HTML file that includes all necessary resources, eliminating external dependencies.
  • Customizable Options: Users can modify default settings through optional parameters tailored to specific project needs.
  • Image Inlining: Automatically converts image sources to base64-encoded format, preserving the page's original appearance.
  • Support for Multiple Outputs: Allows the captured content to be returned as an object or string, based on user preference.
  • Compatibility and Ease of Use: Built with ES6 and transpiled to ES5, it focuses on accessibility across various browsers.
  • Flexible API: Offers options to ignore specific elements during the capture process, enhancing user control over the output.
  • Open Source: Released under the MIT License, encouraging community contributions and feedback.
eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.