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 🙏

© 2025 – Pkg Stats / Ryan Hefner

passbook.js

v1.0.2

Published

All you need to serve passbooks with your Node.js backend

Downloads

9

Readme

#passbook.js ##Little passbook factory. More passbooks, less code. ###Install Download this repo, or install via npm npm install passbook.js ###Preraring keys and certificates

####Pass Type ID

Go to Apple Developer's portal and get your iOS Pass Type ID. If you are using MacOS, export it's key as *.pem file. Be sure that your certificate is signed on the apple developer's portal. Please, use official passbook documentation to do that prorerly.

Note, that if youre are not using MacOS, you should generate Certificate Signing Request (*.csr) file manually. Here is the guide. I've tried to do that stuff using Fedora. It's possible with SSL but a bit more difficult though. Run this in console (if you are not using MacOS keychain). openssl x509 -inform der -in pass.cer -out certificate.pem It will convert the pass.cer to a .pem format the APNS will understand. openssl pkcs12 -nocerts -in pkey.p12 -out pkey.pem It will ask some secret passphrase. Please, remember it, because we will need it later. Then we just need to concatenate the files. Type in Terminal: cat certificate.pem pkey.pem > cert.pem

Also, this commands can help you.

####Apple Worldwide Developer Relations Certification Authority

You'll need to get AppleWWDRCA.cer file here. Then, convert it into pem file using keychain or this command: openssl x509 -inform der -in AppleAWWDRCA.cer -out wwdr.pem

Also, you can prepare keys, using module's function. Just put both AppleWWDRCA.cer and signed p12 file into one directory prepareKeys(path-to-directory-with-AppleWWDRCA.cer-and-*.p12-file-signed-with-your-passTypeId.cer);. It runs node script from this module.

Finally, you'll get the directory with wwrd.pem and Certificates.pem (signed with Pass Type ID) files and one passphrase, you should keep in mind.

###Preparing Passbook stuff

Check out official documentation to know how passbook structure looks like. You'll definetely need min. configurations such as icon and logo pictures, pass.json file. Also Apple requires pictures for Retina displays. To get examples, check out official passbook materials.

The idea of this module was that in some cases you need to create lots of passbooks without big changes, for example some great amount of same passbooks with different serial numbers. For these needs we will store all passbook resources in one folder, all keys - in other. All data is readed from pass.json file, so, please, be sure, that your pass.json file is valid.

###Hey ho, let's go!

To sign passbook, use following code:

var passbook_js = require('passbook.js');   //Our module

passbook_js.createPassbook(type, resorces, keys, password);
// type for passbook type (for example, coupon, boarding ticket, etc)
// resources - path to folder with passbook resources
// keys - path to folder with keys
// password - password for Certificates.pem file

It will create pass.pkpass file in root directory of your server //TODO: save the stuff in other directories. Signing mechanism was taken from this module

Check out if it's valid using the iOS simulator. To send it from your server, be sure, that you set MIME type correctly. To set it in express, add following code to your server.js file express.static.mime.define({'application/vnd.apple.pkpass': ['pkpass']});

Now you're awesome! Stay tuned.