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

gocart-ui

v1.0.0

Published

The Redux implementation for GOCart.

Downloads

5

Readme

gocart-ui

The Redux implementation for GOCart.

Installation

npm install gocart-ui gocart-theme-bananas

Usage

var actions = require('gocart-ui').actions
var Bananas = require('gocart-theme-bananas')
var connect = require('gocart-ui').connect
var createElement = require('react').createElement
var Provider = require('react-redux').Provider
var render = require('react-dom').render
var store = require('gocart-ui').store

store.dispatch(actions.reset(YOUR_DATA))
render(createElement(Provider, { store: store }, createElement(connect(Bananas))), htmlElement)

License

See LICENSE.

gocart-client

A browser client for GOCart.

Installation

npm install gocart-client

Usage

var gocart = require('gocart-client').create({
    host: 'your-gocart-server.com',
})
gocart.getStatus()
    .then(function (status) {})
    .caught(function (err) {})

API Reference

Client.create(options)

Creates the client.

var client = Client.create(options)
options Object
  • host String

    The host. Required.

  • pathname String

    The pathname. Default '/'.

Client Instance Methods

client.createCharge(options)

Creates the charge.

client.createCharge(options)
    .then(function (payload) {})
options Object
  • email String

    The email. Required.

  • metadata Object

    Metadata about the charge. Default undefined.

  • sku String

    The SKU. Should correspond to a key in the Products Object. Required.

  • token String

    The Stripe token. Required.

License

See LICENSE.

gocart-server

A standalone web server for GOCart.

Installation

npm install gocart-server

Usage

The server requires the following environment variables:

CORS_ORIGINS=["https://your-origin.com"]
PORT=8000
SCHEMA_URI=https://your-origin.com/gocart.json
STRIPE_SECRET_KEY=your_stripe_secret_key

Then run:

node ./node_modules/gocart-server/start

License

See LICENSE.

hapi-gocart

A hapi plugin for GOCart.

Installation

npm install hapi-gocart

Usage

var GOCart = require('hapi-gocart')

server.register({
  register: GOCart,
  options: options,
}, function (err) {})

options Object

License

See LICENSE.

gocart-schema

A JSON schema utility for GOCart.

Installation

npm install gocart-schema

Usage

var schema = require('gocart-schema')
var validation = schema.validate(yourObj)

validation.value // the result (with defaults populated)
validation.error // the error (`null` if `yourObj` is valid)

Specification

Schema

GOCart Object

This is the root object for the specification.

Fixed Fields

Field Name | Type | Description ---|:---:|--- info | Info Object | Required. products | Products Object | Required. server | Server Object | Required. stripe | Stripe Object | Required.

Info Object

Defines additional data about the store.

Fixed Fields

Field Name | Type | Description ---|:---:|--- name | String | Required. description | String |

Patterned Objects

Field Pattern | Type | Description ---|:---:|--- ^x- | Any |

Products Object

Patterned Fields

Field Pattern | Type | Description ---|:---:|--- {id} | Product Object | Required.

Product Object

Defines a product. In addition to the subset specified below, can contain the types specified in Stripe Object (these values will override the global Stripe configuration).

Fixed Fields

Field Name | Type | Description ---|:---:|--- amount | Number | Required. description | String | images | [String] | metadata | Any | name | String | plan | String |

Patterned Fields

Field Pattern | Type | Description ---|:---:|--- ^x- | Any |

Server Object

Defines the GOCart server configuration.

Fixed Fields

Field Name | Type | Description ---|:---:|--- host | String | Required. pathname | String |

Stripe Object

Defines the global Stripe configuration. Values can be overriden by individual Product Objects.

Fixed Fields

Field Name | Type | Description ---|:---:|--- allowRememberMe | Boolean | billingAddress | Boolean | bitcoin | Boolean | capture | Boolean | currency | String | image | String | name | String | panelLabel | String | publishableKey | String | Required. receiptEmail | Boolean | shippingAddress | Boolean | billingAddress must be set to true. zipCode | Boolean |

License

See LICENSE.

gocart-service

The core GOCart service.

Installation

npm install gocart-service

Usage

var handleRequest = require('gocart-service')(yourStripeSecretKey, yourSchemaUri)

handleRequest(payload).then(function (res) {})

createHandler()

createHandler(stripeSecretKey: string, schemaUri: string): (payload: object) => Promise

The shape of the payload object is specified in lib/validate.

License

See LICENSE.

gocart-aws

A GOCart service for AWS.

Usage

Deploy to AWS

Verify the endpoint

Replace {YOUR_REST_API_ID} and {YOUR_REGION}.

curl https://{YOUR_REST_API_ID}.execute-api.{YOUR_REGION}.amazonaws.com/gocart/ \
    -H 'Content-Type: application/json' \
    -d '{ "email": "[email protected]" }' \
    -v

License

See LICENSE.