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 🙏

© 2024 – Pkg Stats / Ryan Hefner

launch-epub

v1.1.2

Published

A wrapper to launch unzipped EPUB projects in the browser for quick local testing and development with live reload.

Downloads

6

Readme

Launch-EPUB

A wrapper for BrowserSync and readium-js-viewer to launch unzipped EPUB projects in the browser for quick local testing and development with live reload.

Ideal for usage in the command line or as part of an EPUB development workflow.

Installation

  • Install as Node module with NPM:
npm i launch-epub

CLI (Command Line Interface) Installation

  • Install globally with NPM:

npm i -g launch-epub
  • Or, as a self-contained executable:
git clone https://github.com/thephilgray/launch-epub.git
cd launch-epub
npm i

cd ../
npx pkg launch-epub

# osx-specific

cp launch-epub-macos /usr/local/bin/launch-epub

API

NOTE: EPUB project should be an unzipped directory

  • Install it locally to your project

  • Require and instantiate it, passing in the path to the unzipped EPUB directory as the first argument, and any BrowserSync options as the second.

// index.js

const LaunchEpub = require('launch-epub');

const epubDir = './path-to-epub'; // relative or absolute
const browserSyncOptions = {};
const epubServer = new LaunchEpub(epubDir, browserSyncOptions);

epubServer.start();

// also, epubServer.reload() if needed
// if you need something else from BrowserSync, get the instance like this: epubServer.BrowserSyncInstance
// then you can call methods like `reload` or `pause` directly on the instance like this: epubServer.BrowserSyncInstance.reload()

See https://www.browsersync.io/docs/options for full list of BrowserSync options. NOTE: not all BrowserSync options have been tested or are practical for this use case.

CLI Usage (OSX)

  • Open Terminal (or your preferred terminal application) from Applications
  • Type the following command into Terminal (or your preferred terminal application) window and press return:
launch-epub
  • Drag and drop the project directory into Terminal (or your preferred terminal application) window and press return

  • Press ⌃ (control) + c to stop the application

Options

# launch from within any directory on your computer by specifying the project directory path
launch-epub <epub-project-directory-path>

# specify a port
launch-epub --port=3000

TODO:

  • [ ] Write --help command
  • [ ] Customize readium to make it possible to override or bypass scaling for previews of different aspect ratios and device frames.