NativeScript wrapper around FolioReaderKit for reading EPUB files (iOS and Android)
npm install @kakha13/epub-readerNativeScript plugin for reading EPUB files on iOS and Android. This plugin uses custom updated packages for both platforms.
``bash`
npm install @kakha13/epub-reader
This plugin uses updated versions of FolioReader libraries:
- iOS: FolioReaderKitEpub - A Swift ePub reader and parser framework for iOS
- Android: FolioReader-Android - An EPUB reader written in Java and Kotlin




You can open EPUB files from either the app bundle (relative path) or from anywhere on the device (absolute path):
`ts
import { EpubReader } from '@kakha13/epub-reader';
const reader = new EpubReader();
// Open from app bundle (relative path)
reader.open('books/sample.epub');
`
`ts
import { EpubReader } from '@kakha13/epub-reader';
import { Http, knownFolders } from '@nativescript/core';
const reader = new EpubReader();
// Download and store EPUB file
const tempFolder = knownFolders.temp().getFolder('books.temp/');
const url = 'https://example.com/book.epub';
const fileName = url.split('/').pop();
Http.getFile(url, ${tempFolder.path}/${fileName})`
.then(file => {
// Open using absolute path
reader.open(file.path);
})
.catch(error => {
console.error('Download failed:', error);
});
- Supports both iOS and Android platforms.
- iOS: The plugin declares a CocoaPods dependency on FolioReaderKit from FolioReaderKitEpub (branch master); it is bundled automatically via the plugin Podfile. If you maintain a custom App_Resources Podfile, ensure this pod remains included.include.gradle` file.
- Android: The plugin uses FolioReader-Android via JitPack (version 4). The dependency is automatically included via the plugin's
- Methods throw if the epub file cannot be found or there is no active page to present from, to make integration failures visible.
Apache License Version 2.0