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

leanpub-workflow

v0.7.2

Published

E-Book workflow with dropbox and leanpub

Downloads

24

Readme

About

This utility helps with creating and publishing an e-book via Leanpub. It covers processing of images, syncing of images and text files with DropBox, and creating full or partial previews on Leanpub.

Install

npm install -g leanpub-workflow

Preparation

You'll need a Leanpub account and a Dropbox account. There's no need for a DropBox client on the PC (but it doesn't harm either).

{  
  "dropbox_api":"dont-tell-anybody",
  "leanpub_api": "keep-it-secret",
  "leanpub_slug": "mycoolbook",
  "dropbox_basedir": "/mycoolbook/manuscript",
  "local_basedir": "/home/myname/bookproject",
  "images_raw": "/home/myname/bookproject/img-raw",
  "images_dest": "/home/myname/bookproject/images",
  "images_width": 480
}

Usage

  • interactive mode: When called without parameters, leanpub-workflow will present a menu to chose from.

  • batch mode: When called with one or more parameters, leanpub will not show the menu, but instead execute the command given in the first parameter.

Configuration

By default, leanpub-workflow tries to load a file 'leanpub-config.json' from the current directory. You can chose a different file with the option --config or -c:

leanpub-workflow -c </path/to/other-config.json> [command]

Possible operations are:

Option 1: Process images - command: images

This will consider all images found in the folder denoted by images_raw in the config and copy them to the folder images_dest.

  • If the image width is above the images_width config, it will resize the image so that the width is images_width and the height is reduced accordingly to keep aspect ratio.

  • If the image width is less than images_width, does not change size.

  • If the Image is not in jpg-Format, converts to jpg

  • Original images are not modified.

Option 2: Sync images and texts - command: sync

This will consider all images in images_dest and all *.md files in local_basedir

  • If a file exists locally but not in the Dropbox -> send it to DropBox.

  • If a file exists in the DropBox, but not locally -> delete it in the DropBox.

  • If a file is newer locally than in the DropBox -> Send it to the DropBox.

  • If it is a file with *.md Extension, send it with a *.txt extension.

  • Files which are not in the images_dest folder and have not the extension .md are ignored.

Option 3: Create single file preview - command: single

Doesn't work. Currently gets always a "500" error from the server. Probably I didn't get the syntax right.

Option 4: Create subset preview - command: subset

Create a Preview from the files named in Subset.md/Subset.txt. The Preview is stored in the Dropbox previews-Folder.

Option 5: Create full preview - command: full

Create a Preview from the files named in Book.md/Book.txt. The preview will be stored in the Dropbox previews-Folder.

Option 6: Show job status - command: status

Leanpub jobs can take quite some time. The status command shows if a job is still running, and what is its state.

Option 7: Download preview - command: fetch

Downloads the last preview pdf from the Dropbox to the current folder. The Filename will be ${leanpub_slug}-preview.pdf

Option v: Show Version - command: version

Display the program version and exit

Tests

npm test

License

Apache 2.0