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

@epubknowledge/contents

v0.1.2

Published

NPM Package that gets ePub contents from a passed directory and returns as object

Readme

Epub Knowledge Contents

Code Climate maintainability Code Climate issues Github code size GitHub issues GitHub last commit GitHub forks GitHub stars Version

This package is a foundation block intended to be used for other NPM packages and is designed to retrieve all contents of a passed directory and return it as an object.

Install

npm:

npm i @epubknowledge/contents

yarn:

yarn add @epubknowledge/contents

If either command cause an error in the terminal reference this issue.

Use

const contents = require('@epubknowledge/contents')

Options

Currently this takes two options:

contents(directory, arguments)

Returned Object

Explained parameters returned and with an example from Moby Dick's package.opf:

{
  path: {
    full: '/OPS/package.opf', ## Full path of file that includes filename
    file: '/OPS/' ## Path without filename
  },
  filename: 'package.opf', ## The name of the file
  ext: '.opf', ## The file extension, will default to null on hidden or files that dont have an extension
  size: 22175, ## The size of the file
  dirname: 'OPS' ## The directory the file or folder is located in
}

Directory

The first option directory is required and accepts two path types:

  • relative: desktop
  • absolute: /Users/username/desktop

If you're still unaware of what the differences are read:

When directory is passed into contents() it will validate if is directory and and if it exists. If both tests fail the code will error out. If the submitted directory is relative it will build it as an absolute path.

Arguments

Second option takes regex and it can be either a string or array. If the regex passed is invalid the then returned object will be empty. For further help with regex visit Examples.

Disclaimer

Test ePub source files used in the regex examples and as a test case come from IDPF's epub example "Moby Dick"*.

Reference: IDPF | "Moby Dick"