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

pizzapi

v0.0.8

Published

node js API for Domino's pizza

Downloads

24

Readme

PizzaPI API

This is a node.js wrapper for the Domino's pizza APIs. The original npm module dominos has stopped being maintained and will remain at it's last stable release. For new applications please use this new npm module pizzapi. See the pretty PizzaPI documentation

Join the chat at https://gitter.im/RIAEvangelist/node-dominos-pizza-api

NPM Stats for dominos api NPM Download Graph for dominos api

This work is licenced via the DBAD Public Licence. It is a derivative work from Dominos API.

Install PizzaPI

npm install pizzapi

Contributing

  1. Pull or Fork code.
  2. from the cloned directory run npm install (this will install required dependancies, depending on your system may require)
  3. be awesome!

Examples

See the examples directory for simple apps and demonstrations on using the basic functionality.

Testing

Simply run npm test if you have issues with this you may want to try installing mocha globally like this : npm install -g mocha

-OR for manual testing-

  1. Install mocha npm install -g mocha
  2. Run the tests mocha

Finding Stores

|argument|type|default|required| |--------|----|-------|--------| |address|full or partial address string|null|true| |callback|function to pass the api result to|null|true| |type|Delivery, Carryout, all| all | false|

By Postal Code

this yields the least accurate information

var pizzapi=require('pizzapi');

pizzapi.Util.findNearbyStores(
    '63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

By City and Postal Code

this yields less accurate information but is better than just using the postal code

var pizzapi=require('pizzapi');

pizzapi.Util.findNearbyStores(
    'St. Louis, MO, 63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

Using Full or Nearly Full Address

this yields the best information and sorts stores by actual distance

var pizzapi=require('pizzapi');

pizzapi.Util.findNearbyStores(
    '700 Clark Ave, St. Louis, MO, 63102',
    'Delivery',
    function(storeData){
        console.log(storeData);
    }
);

Store

|argument|type|default|required| |--------|----|-------|--------| |ID|Integer|null|true|

//Get Store Info for Store #4336
var pizzapi=require('pizzapi');
var myStore=new pizzapi.Store();
myStore.ID=4336;

myStore.getInfo(
    function(storeData){
        console.log(storeData);
    }
);

Store menu

|argument|type|default|required| |--------|----|-------|--------| |callback|function to pass the api result to|null|true|

//Get Menu for Store #4336
var pizzapi=require('pizzapi');
var myStore=new pizzapi.Store();
myStore.ID=4336;

myStore.getMenu(
    function(storeData){
        console.log(storeData);
    }
);

Store info

|argument|type|default|required| |--------|----|-------|--------| |callback|function to pass the api result to|null|true|

Friendly menu list

Returns a list of all items the store offers in an JSON array, formatted {Code: Friendly Name}


Address

When creating a new Address object, there are many ways to instantiate the object! Order does matter with strings and arrays.

The following are examples of the methods:

By string

var fullAddress = new Address('900 Clark Ave, St. Louis, MO, 63102');

//or

var partAddress = new Address('St. Louis, MO, 63102');

//or

var onlyZip = new Address('63102');

//or

var onlyCity = new Address('St. Louis');

####By JSON

var jsonAddress = new Address({
  Street: '900 Clark Ave',
  City: 'St. Louis',
  Region: 'MO',
  PostalCode: 63102
  });

By array

var arrayAddress = new Address(['900 Clark Ave', 'St. Louis', 'MO', '63102']);

Customer

|argument|type|default| |--------|----|-------| |address|Address|null| |firstName|String|''| |lastName|String|''| |email|String|''| |phone|String|''|

var customer = new Customer({
  address: someAddressObj,
  firstName: 'Barack',
  lastName: 'Obama',
  phone: '1-800-The-White-House',
  email: 'br'
})

Item
====
|argument|type|default|
|--------|----|-------|
|code|String|null|
|quantity|Integer|1|
|options|Array|[]|

```javascript
var newItem = new Item({ code: '14SCREEN' });

//and so on...

Order

This is the class that every other class feeds into.

|argument|type|default| |--------|----|-------| |code|String|null| |quantity|Integer|1| |options|Array|[]|

creating an order

var pizzapi=require('pizzapi');

var thePresident = new pizzapi.Customer(
    {
        firstName: 'Barack',
        lastName: 'Obama',
        address: '700 Pennsylvania Avenue, Washington, DC',
        email: '[email protected]'
    }
);

var order = new pizzapi.Order(
    {
        customer: thePresident,
        storeID: myStore.ID,
        deliveryMethod: 'Delivery' //(or 'Carryout')
    }
);

Adding a product to the order :

order.addItem(
    new pizzapi.Item(
        {
            code: '14SCREEN',
            options: {},
            quantity: 1
        }
    )
);

Validating an Order

This step is *Strongly recommended

order.validate(
    function(result) {
        console.log("We did it!");
    }
);

Price an Order

order.price(
    function(result) {
        console.log("Price!")
    }
);

Place an Order

At least one item must've been added to place an order.

order.place(
    function(result) {
        console.log("Order placed!");
    }
);

Tracking

### By Phone

|argument|type|default|required|
|--------|----|-------|--------|
|phone|Phone number string or int|null|true|
|callback|function to pass the api result to|null|true|

    var pizzapi=require('pizzapi');

    pizzapi.Track.byPhone(
        2024561111,
        function(pizzaData){
            console.log(pizzaData);
        }
    );

### By orderKey

|argument|type|default|required|
|--------|----|-------|--------|
|orderKey|string or int|null|true|
|storeID|sting or int|null|true|
|callback|function to pass the api result to|null|true|

    var pizzapi=require('pizzapi');

    pizzapi.Track.byId(
        123456,
        12345,
        function(pizzaData){
            console.log(pizzaData)
        }
    );

Original module

Depricated due to massive overhauling by @madelinecameron
Still in npm for use of last version in production as dominos

npm install dominos

NPM Stats for dominos api NPM Download Graph for dominos api dominos api package quality