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

passbookster

v0.1.4

Published

iOS Apple passbook library

Downloads

479

Readme

Install

$ npm install passbookster

Usage

To create a pass, you first create a pass template which holds information that remains static for each subsequent pass created from the template. Then you can create a Pass by providing the rest of the fields and images.

A Pass can act as a stream, or as a plain-callback async operation. Performance-wise you should use the stream interface, when its possible to pipe the pass to another stream. (eg store to filesystem or Amazon S3)

You'll also need the Apple Worldwide Developer Relations (WWDR) certficate and your pass certificate.

openssl must be installed, and inside the $PATH. It is used internally to calculate the pass signature, since node crypto API does not support PKCS 7. (TODO).

Example

var passbook = require('passbookster')

var template = passbook.createTemplate('coupon', {
  passTypeIdentifier: 'PASS_TYPE_ID',
  teamIdentifier:     'TEAM_ID',
  organizationName:   'Paw Planet'
}, {
  certs: {
    wwdr: '/path/to/wwdr.pem',
    pass: '/path/to/pass_cert'
  }
})

var pass = template.createPass({
  serialNumber:    'E5982H-I2',
  backgroundColor: 'rgb(206, 140, 53)',
  description:     '20% off premium dog food',
  icon:            fs.createReadStream('/path/to/icon.png')
})

pass.pipe(fs.createWriteStream('pass.pkpass'))

API

Template

Constructor

var template = passbook.createTemplate(style, fields, options)

style

The style of the pass.

Must be one of: 'boardingPass', 'coupon', 'eventTicker', 'storeCard', 'generic'

fields

Any field that should be included in all passes created from this template. Usually you want these to be passTypeIdentifier, teamIdentifier and organizationName, but it's completely ok to pass any pass field. These will be merely copied to each pass you create.

options

Object containing extra information about this pass. Only certificates for now.

options.certs

Object with keys wwdr and pass and values the paths to the apple WWDR certificate and the pass certificate.

Methods

template.certs(certs)

certs

An object containing paths to apple wwdr and the pass certificate.

certs.wwdr

Pass to apple wwdr certificate

certs.pass

Pass to pass certificate

Pass

Constructor

template.createPass(fields, cb)

fields

Rest of the fields you want this pass to have. Fields provided to the template will be included.

cb

Optional callback function. If a callback is provided, then the pass will not act as a stream, and will call this function as cb(err, res) when its done. Result is a buffer of the .pkpass created.

Tests

export WWDR_CERT=/path/to/wwdr.cert
export PASS_CERT=/path/to/pass.cert

npm test

TODO

  • More and proper tests
  • Add PKCS7 signing to node crypto