npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

epub-flow

v0.0.16

Published

A premium, feature-rich EPUB reader library for Angular applications. Built with performance, aesthetics, and ease of use in mind.

Downloads

1,013

Readme

epub-flow 📖

A premium, feature-rich EPUB reader library for Angular applications. Built with performance, aesthetics, and ease of use in mind.

✨ Features

  • 📖 Smooth Reading: Powered by Epub.js for reliable rendering.
  • 🌓 Aesthetic Dark Mode: Support for modern dark aesthetics with rgb(32 33 32) background.
  • 🖋️ Rich Text Notes: Integrated ngx-editor for professionally formatted notes.
  • 📚 Beautiful TOC: Hierarchical Table of Contents with smooth navigation.
  • 🖼️ Cover Preview: pulse-animated book cover previews during load.
  • 🏷️ State-Managed Annotations: Fully event-driven highlights and underlines.
  • 📱 Responsive: Mobile-first design that looks great on any device.
  • 🔍 Advanced Search: Case-insensitive search with highlighted snippets.
  • ⚙️ Customizable: Toggle features like text selection, font sizing, and chapter lists.

🚀 Installation

Install the package via npm:

npm install epub-flow --legacy-peer-deps

Ensure the following peer dependencies are installed:

npm install epubjs ngx-editor @angular/cdk --save

🛠 Setup

1. Import EpubReaderModule

Add EpubReaderModule to your module:

import { EpubReaderModule } from 'epub-flow';


@NgModule({
  imports: [
    EpubReaderModule,
    // ... other imports
  ]
})
export class AppModule { }

2. Include Required Styles

Add the necessary styles to your styles.scss or angular.json:

/* In styles.scss */
@import "ngx-editor/lib/styles/editor.scss";

📖 Usage

Basic Usage

<epub-flow [epubBlob]="myEpubBlob"></epub-flow>

Advanced Usage (Event-Driven)

The component is designed to be stateless regarding annotations, allowing the parent application to manage persistence.

<epub-flow 
  [epubBlob]="bookBlob" 
  [underlineCfiList]="myUnderlines"
  [highlightCfiList]="myHighlights"
  [bookmarkCfiList]="myBookmarks"
  (underlineAddRequest)="onUnderlineAdd($event)"
  (underlineRemoveRequest)="onUnderlineRemove($event)"
  (highlightAddRequest)="onHighlightAdd($event)"
  (highlightRemoveRequest)="onHighlightRemove($event)"
  (bookmarkAddRequest)="onBookmarkAdd($event)"
  (bookmarkRemoveRequest)="onBookmarkRemove($event)">
</epub-flow>
// Example Handler
onHighlightAdd(event: {cfi: string, color: string}) {
  console.log('User added highlight:', event.cfi, 'with color:', event.color);
  // 1. Save to your DB via API
  // 2. Update your local 'myHighlights' array to persist across sessions
}

⚙️ Configuration

Inputs

| Input | Type | Default | Description | |---|---|---|---| | epubBlob | Blob | null | Local Blob object for direct loading. | | coverPage | string | null | URL to a cover image displayed during loading. | | underlineCfiList | string[] | UnderlinePayload[] | [] | List of CFIs (strings) or objects {cfiLocation, colorCode} to be underlined. | | underlineColor | string | null | Default color for underlines (e.g. '#FF0000'). Overrides theme contrast color. | | highlightCfiList | {cfi:string, color:string}[] | [] | List of objects to be rendered as highlights. | | bookmarkCfiList | string[] | [] | List of CFIs to be rendered as bookmarks. | | pagePosition | string | null | The CFI location to navigate to on load or change. | | colourCodeList | string[] | ['#F44336', ...] | List of hex codes for highlight colors. | | underlineColorList | string[] | null | Optional list of colors. If provided, enables color picker for underlines. | | menuConfig | MenuConfig | null | Configuration for custom menu items and quick actions. | | enableDarkMode | boolean | true | Toggle Dark Mode availability. | | enableSearch | boolean | true | Toggle the Search tool. | | enableHighlights | boolean | true | Toggle Underline/Highlighting tools. | | enableBookmarks | boolean | true | Toggle Bookmarking tool. | | enableNotes | boolean | true | Toggle Rich Text note creation. | | enableChapterList | boolean | true | Toggle Chapter List availability. | | enableFontSize | boolean | true | Toggle Font size adjustment controls. | | enableTextSelection | boolean | true | Toggle ability to select text. |

Outputs

| Output | Payload | Description | |---|---|---| | underlineAddRequest | UnderlinePayload | Emits when a user selects text to underline (includes optional color). | | underlineRemoveRequest | {cfi: string} | Emits when a user confirms removal of an underline. | | highlightAddRequest | HighlightPayload | Emits when a user selects a highlight color. | | highlightRemoveRequest | {cfi: string} | Emits when a user confirms removal of a highlight. | | bookmarkAddRequest | BookmarkPayload | Emits when a user adds a bookmark (Capture CFI, Color, Percentage). | | customMenuAction | {id: string, data: any} | Emits when a custom menu item is clicked. | | bookmarkRemoveRequest | BookmarkPayload | Emits when a user removes a bookmark. | | pagePositionOnDestroy | string | Emits the current CFI when the component is destroyed. |

📄 License

MIT