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

readarepo-zip

v0.1.1

Published

Convert a git repo to zipped up html to read anywhere.

Downloads

15

Readme

Table of Contents generated with DocToc

What

Convert a git repo into html pages to read anywhere.

How

Given a repository url or a local folder, it will convert all files into syntax highlighted .html files, while maintaining the original folder structure.

Finally it will create a zip file of all highlighted files which you can then read on a reader like iPad, e.g., with GoodReader

Install

Requires python to be installed.

npm install readarepo-zip

Run

Convert a repository

Convert a github repository use readarepo-zip.js.

Running it without parameters will print the following guide:

> node ./readarepo-zip.js

Options:
-u, --url          [required]
-t, --target       [default: "./tmp"]
-d, --directories  [default: "!.git,!node_modules"]
-f, --files        
-h, --highlighter  [default: "pygments"]
-l, --loglevel     [default: "info"]

Missing required arguments: u

As an example, in order to convert this repository you would do:

node readarepo-zip.js -u https://github.com/thlorenz/readarepo-zip -d '!.git,!3rd' 
  • -d '!.git,!3rd' makes sure we don't attempt to convert the '.git' folder or the '3rd' which (contains a copy of the pygments library.

  • read more about file and directory filters on the fsrec repository since readarepo-zip uses it under the hood.

Convert a folder

In order to convert all files found within a folder on your machine, use readafolder-zip.js.

Running it without parameters will print the following guide:

> node readafolder-zip

Options:
-s, --source       [required]
-t, --target       [default: "./tmp"]
-d, --directories  [default: "!.git,!node_modules"]
-f, --files        
-h, --highlighter  [default: "pygments"]
-l, --loglevel     [default: "info"]

Missing required arguments: s

As an example, in order to convert folder './foo' (excluding '.svn' folders) and store it inside './foo_converted', you would do:

node readafolder-zip.js -s ./foo -t ./foo_converted -d '!.svn'
  • filters work the same as explained above

API

In order to support using readarepo-zip as a service, it exposes all necessary functions via the service module.

As a guide on how to use it look inside readarepo-zip.js and readafolder-zip.js.

Most functions take a function as last parameter which will be invoked once the task is complete.

Here is a list of the ones you may most likely use:

  • convertFolder: function (rootPath, opts, convertedFolderCb)
  • cloneAndConvert: function (opts, clonedAndConvertedCb)
  • startPygmentsService: function(cb)
  • stopPygmentsService: function()

For more information - soon - you may also look at the readarepo-web project which leverages this API to expose readarepo-zip as a service on the web.