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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@86d-app/delivery-slots

v0.0.25

Published

Delivery slots — define delivery time windows by day of week with capacity limits, surcharges, and blackout dates

Readme

@86d-app/delivery-slots

Delivery slots module for 86d commerce platform. Allows store owners to define delivery time windows by day of week with capacity limits and optional surcharges, and customers to book a delivery slot during checkout. Supports blackout dates to block deliveries on holidays or special occasions.

Installation

Add to your store's module configuration:

import deliverySlots from "@86d-app/delivery-slots";

export const modules = [
  deliverySlots({
    horizonDays: 14, // optional — days ahead to show slots
  }),
];

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | horizonDays | number | 14 | Number of days into the future to show available slots |

Store endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /delivery-slots/available?date=YYYY-MM-DD | List available slots for a date with remaining capacity | | POST | /delivery-slots/book | Book a delivery slot for an order | | POST | /delivery-slots/bookings/:id/cancel | Cancel a delivery booking | | GET | /delivery-slots/order/:orderId | Get the confirmed delivery booking for an order |

Admin endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /admin/delivery-slots | List all delivery schedules (filterable by day, active) | | POST | /admin/delivery-slots/create | Create a delivery schedule | | GET | /admin/delivery-slots/summary | Dashboard summary stats | | GET | /admin/delivery-slots/:id | Get schedule detail | | POST | /admin/delivery-slots/:id/update | Update a schedule | | POST | /admin/delivery-slots/:id/delete | Delete a schedule | | GET | /admin/delivery-slots/bookings | List bookings (filterable by date, order, customer, status) | | POST | /admin/delivery-slots/bookings/:id/cancel | Cancel a booking | | GET | /admin/delivery-slots/blackouts | List all blackout dates | | POST | /admin/delivery-slots/blackouts/create | Create a blackout date | | POST | /admin/delivery-slots/blackouts/:id/delete | Delete a blackout date |

Controller API

interface DeliverySlotsController {
  // Schedule CRUD
  createSchedule(params: CreateScheduleParams): Promise<DeliverySchedule>;
  updateSchedule(id: string, params: UpdateScheduleParams): Promise<DeliverySchedule | null>;
  getSchedule(id: string): Promise<DeliverySchedule | null>;
  listSchedules(params?: ListSchedulesParams): Promise<DeliverySchedule[]>;
  deleteSchedule(id: string): Promise<boolean>;

  // Booking management
  bookSlot(params: BookSlotParams): Promise<DeliveryBooking>;
  cancelBooking(id: string): Promise<DeliveryBooking | null>;
  getBooking(id: string): Promise<DeliveryBooking | null>;
  getOrderBooking(orderId: string): Promise<DeliveryBooking | null>;
  listBookings(params?: ListBookingsParams): Promise<DeliveryBooking[]>;

  // Availability
  getAvailableSlots(params: AvailableSlotsParams): Promise<SlotAvailability[]>;
  getSlotBookingCount(scheduleId: string, date: string): Promise<number>;

  // Blackout dates
  createBlackout(params: CreateBlackoutParams): Promise<DeliveryBlackout>;
  deleteBlackout(id: string): Promise<boolean>;
  listBlackouts(): Promise<DeliveryBlackout[]>;
  isBlackoutDate(date: string): Promise<boolean>;

  // Analytics
  getSummary(): Promise<DeliverySlotsSummary>;
}

Types

DeliverySchedule

| Field | Type | Description | |-------|------|-------------| | id | string | Unique ID | | name | string | Display name (e.g. "Weekday Morning") | | dayOfWeek | number | 0 = Sunday … 6 = Saturday | | startTime | string | Start time in HH:MM 24-hour format | | endTime | string | End time in HH:MM 24-hour format | | capacity | number | Maximum bookings per slot occurrence | | surchargeInCents | number | Surcharge in cents (0 = no surcharge) | | active | boolean | Whether customers can book this slot | | sortOrder | number | Display order within the same day |

DeliveryBooking

| Field | Type | Description | |-------|------|-------------| | id | string | Unique ID | | scheduleId | string | Associated schedule | | deliveryDate | string | Specific delivery date (YYYY-MM-DD) | | orderId | string | Associated order | | customerId | string? | Customer who booked | | scheduleName | string | Schedule name (snapshotted) | | startTime | string | Time window start (snapshotted) | | endTime | string | Time window end (snapshotted) | | surchargeInCents | number | Surcharge charged (snapshotted) | | status | "confirmed" \| "cancelled" | Booking status | | instructions | string? | Delivery instructions |

DeliveryBlackout

| Field | Type | Description | |-------|------|-------------| | id | string | Unique ID | | date | string | Blocked date (YYYY-MM-DD) | | reason | string? | Reason displayed to customers |

SlotAvailability

| Field | Type | Description | |-------|------|-------------| | schedule | DeliverySchedule | The schedule | | date | string | The queried date | | booked | number | Confirmed booking count | | remaining | number | Slots still available | | available | boolean | Whether the slot can be booked |

Notes

  • Schedules define recurring weekly slots — a "Monday 08:00–12:00" schedule applies to every Monday
  • Each order can have at most one confirmed delivery booking
  • Surcharges are snapshotted when booked — later changes don't affect existing bookings
  • Cancelled bookings free up capacity for new bookings
  • Blackout dates block all deliveries regardless of schedule configuration
  • All monetary amounts are in cents to avoid floating-point issues
  • Booking date must match the schedule's day of week (e.g. can't book a Monday schedule for a Tuesday)