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

safarid

v1.0.0

Published

a SafariBooksOnline-Downloader and .epub creator

Downloads

4

Readme

SafariBooks Downloader & ePub Generator

SafariBooks-Downloader is a project created and maintained by Nico Haenggi.

The project is currently setup in two branches.

  • master also known as stable - The ePub generator 'should' be stable on this branch, and is generally well tested
  • dev also known as unstable - The ePub generator is being developed on this branch, and is not always well tested and stable

Support

If you discover a bug in the generator, please search the issue tracker first. If it hasn't been reported, please create a new issue.

Feature Requests

If you have a great idea to improve the generator, please search the feature tracker first to ensure someone else hasn't already come up with the same great idea. If it hasn't been requested, please create a new request. While you're there vote on other feature requests to let the me know what is most important to you.

Pull Requests

If you'd like to make your own changes ensure your Pull Request is made against the dev branch.

Installation Guide

How To Install

Install Node.js. We recommend the LTS release. The SafariBooks-Downloader has been tested on most node versions between v4.4.5 and v.6.9.5 and should therefore cause no problems running on one of these versions. For more information about how to install it on your environment, see Installing Node.js via package manager. To verify your installation, run:

node -v

If a version is returned, you did successfully install Node.js. Next up, make sure npm is properly installed. To verify, run:

npm -v

If the command returns a version number, you're all set. Next, we'll clone the repository.

git clone https://github.com/nicohaenggi/SafariBooks-Downloader.git
cd SafariBooks-Downloader

Install all the dependencies with npm.

npm install

Congratulations! You've successfully installed SafariBooks-Downloader. If you desire to do so, you can install the tool globally on your machine. To do so, run:

npm install -g

To verify the installation, please run:

safaribooks-downloader --version

If the command returns a version number, you have successfully installed the tool globally. The current release is v1.0.0.

How To Update

  1. Stop the downloader if it's running. (use control + c to stop it)
  2. Run git pull
    This will update the generator to the latest master branch
  3. Reinstall dependencies with npm install or npm install -g
    using npm install -g will install the generator globally
  4. Run safaribooks-downloader --version
    After you are done following it this will print out the current version of the generator.

How To Run

The tool provides the following six options. The options --bookid, --username, --password and --output are required. However, if the username and password options are provided once, they will be cached and are no longer required to run the CLI.

Options

  • -h, --help
    • displays usage information
  • -V, --version
    • displays version number
  • -b, --bookid
    • the book id of the SafariBooksOnline ePub to be generated you can find the book id by having a look at the URL while reading the book e.g. https://www.safaribooksonline.com/library/view/building-apis-with/9781484224427/A435096_1_En_7_Chapter.html whereas the id will be 9781484224427
  • -u, --username
    • username of the SafariBooksOnline user - must have a paid/trial membership, otherwise will not be able to access the books
  • -p, --password
    • password of the SafariBooksOnline user
  • -o, --output
    • output path the epub file should be saved to. On some systems, the path may require to contains no whitespaces.
  • -d, --debug
    • enable debug mode for request package.

Example

An example showing how a SafariBooksOnline with id 9781484224427 is downloaded and converted into a ePub file testbook.epub.

safaribooks-downloader -b 9781484224427 -u nicohaenggi -p MySuperSecurePassword -o /Users/nicohanggi/Desktop/testbook.epub

An example showing how a SafariBooksOnline with id 9892595335538 is downloaded and converted into a ePub file testdebugbook.epub.

safaribooks-downloader -d -b 9781484224427 -u nicohaenggi -p MySuperSecurePassword -o /Users/nicohanggi/Desktop/testbook.epub

Features

  • [x] generating ePub with cover image, authors and publisher
  • [x] custom stylesheets will be imported (only one currently)
  • [ ] support for several different stylesheets in one book
  • [ ] directly generating .mobi files

Credits

  • Nico Haenggi: conception & development
  • cyrilis: a big thanks to cyrillis for his epub-gen package which I relied upon heavily while integrating my own epub generator

Copyright & License

Copyright (c) 2017 Nico Haenggi - Released under the MIT License