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

substripe

v0.0.1

Published

Extremely simple subscription payment form with Stripe in seconds.

Downloads

21

Readme

Substripe NPM version Gittip

Substripe

Extremely simple subscription payment form with Stripe in seconds.

Great for charging {{someone}} for a monthly subscription to {{something}}.

Try out the demo at http://substripe.com:3000/plan/demo (enter credit card 4242-4242-4242-4242 with any valid exp date and any CVC).

View this documentation at http://documentup.com/niftylettuce/substripe.

Quick Start

npm install -g substripe
  • Spin up a server in either development or production mode (see below).

Environment Variables

Here are the following environment variables and their default values.

| Environment Variable | Default Value | Description | -------------------- | --------------- | ----------- | SK | None (required) | Stripe secret key | PK | None (required) | Stripe public key | PUBLIC | ./ | Path to public directory for serving assets (e.g. Stripe Checkout image, see below Tricks) | PORT | 3000 | Port to run substripe server on | NODE_ENV | development (if value is "production", then PORT is set to 443) | Node.js environment (either "development" or "production") | KEY | None (required in production) | Path to SSL key | CERT | None (required in production) | Path to SSL cert | CA | None (required in production) | Path to SSL CA cert

Development Mode

PUBLIC=./ PORT=3000 SK=stripe-test-sk PK=stripe-test-pk

http://localhost:3000/plan/{{stripe_plan_id}}

Production Mode

Register a domain name and an SSL certificate (e.g. PositiveSSL or RapidSSL) at Namecheap (affiliate link, you can use coupon "DOMAINZZ" as of Feb 7, 2014 to save some bones).

Port is automatically set to 443 (https protocol) in production mode (as required by Stripe), so you don't need to pass PORT environment variable like in development mode (see above).

You need to pass a valid path to the SSL certificate's key, cert, and CA files as well.

NODE_ENV=production KEY=./key.pem CERT=./cert.pem CA=./ca.pem PUBLIC=./ SK=stripe-live-sk PK=stripe-live-pk substripe

https://yourdomain.com/plan/{{stripe_plan_id}}

Tricks

You can add the following options as querystring parameters to pre-populate the Stripe checkout form. These options are the same the Configuration Options from Stripe.

(e.g. pre-populate an image and an email address of the customer https://yourdomain.com/{{stripe_plan_id}}?image=%2Fsubstripe.png&[email protected])

| Param | Default Value | ---------------- | -------------- | image | "/substripe.png" | name | display name | description | "Subscribe to {{plan.name}}" | amount | {{plan.amount}} (cents) | currency | "usd" | panel_label | "Subscribe @ ${{plan.amount}}/{{plan.interval}}" | billing_address | false | shipping_address | false | email | "" | label | "Subscribe @ ${{plan.amount}}/{{plan.interval}}"

NOTE: Default value's for panel_label and label have the values of {{plan.interval}} abbreviated (e.g. "week" => "wk", "month" => "mo", "year" => "yr").

License

The MIT License

Copyright (c) 2014- Nick Baugh [email protected] (http://niftylettuce.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.