← All packages

@lacspace/booking

v1.0.0Mail Kit0 deps

Meeting slot finder and calendar invites: free slots from busy intervals with working hours, IANA time zones via Intl (DST-correct, half/quarter-hour offsets like Asia/Kathmandu +05:45), buffers around busy times, minimum notice, holidays, custom work weeks (e.g. Nepal Sun-Fri); human-readable slot proposals in English or Nepali; and RFC 5545/5546 iTIP REQUEST invites (VEVENT with CRLF, 75-octet UTF-8-safe folding, escaping, DTSTAMP, UID). Zero dependencies, isomorphic.

npm i @lacspace/booking

Usage

booking.ts
import { freeSlots, proposeText, invite } from "@lacspace/booking";

const slots = freeSlots({
  busy: [{ start: "2026-10-13T05:00:00Z", end: "2026-10-13T06:00:00Z" }],
  from: "2026-10-12T00:00:00Z",
  to: "2026-10-16T00:00:00Z",
  durationMinutes: 30,
  hours: { start: "10:00", end: "17:00", days: [0, 1, 2, 3, 4, 5] }, // Sun–Fri
  timezone: "Asia/Kathmandu",
  buffer: 15,
  minNoticeMinutes: 120,
  holidays: ["2026-10-14"],
});
// [{ start: "2026-10-12T04:15:00.000Z", end: "2026-10-12T04:45:00.000Z" }, …]

proposeText(slots, { timezone: "Asia/Kathmandu" });
// "Mon 12 Oct, 10:00–10:30 (NPT)\nMon 12 Oct, 10:30–11:00 (NPT)\nMon 12 Oct, 11:00–11:30 (NPT)"

proposeText(slots, { timezone: "Asia/Kathmandu", style: "sentence", limit: 2 });
// "Mon 12 Oct 10:00–10:30 or Mon 12 Oct 10:30–11:00 (NPT)"

const { ics, method } = invite(slots[0], {
  title: "Intro call",
  organizer: { name: "Lacspace Sales", email: "sales@lacspace.com" },
  attendees: [{ name: "Sita Sharma", email: "sita@example.com" }],
  url: "https://meet.example.com/abc",
  timezone: "Asia/Kathmandu",
});
// Attach as text/calendar; method=REQUEST

Exports 13

escapeTextfoldLinefreeSlotsfromLocalicsDateinviteisValidTimeZonemergeIntervalsoffsetMinutesproposeTextresolveLocaletoLocalzoneLabel

Keywords

bookingschedulingcalendarmeetingfree-busyavailability

More in Mail Kit

@lacspace/email-templates

Compose bulletproof, responsive, dark-mode HTML emails from simple blocks, plus 13 ready-made transactional templates (OTP, verify, password-reset, magic-link, receipt, order, shipping, invitation, digest, announcement). Ships plaintext generation, preheaders and {{var}} i18n interpolation. Zero-dependency, isomorphic.

@lacspace/email-validate

Smart, network-free email validation — RFC-5322 syntax (incl. quoted local parts & IP-literal domains), disposable/temp-mail & role-account detection, free-provider flags, Gmail normalization and 'did you mean?' typo suggestions. Zero-dependency, isomorphic.

@lacspace/email-verify

Best-effort email deliverability for Node — syntax + disposable/role, MX lookup with priority ranking, an optional SMTP RCPT probe (no mail sent), catch-all detection, a 0-100 confidence score, and de-duped batch verification. All DNS/SMTP injectable; zero npm dependencies.

@lacspace/mailer

A tiny zero-dependency SMTP client for Node — send email over raw net/tls with STARTTLS & AUTH, plus a fluent MIME builder (inline images, attachments, alternatives), RFC 5322 address + RFC 2047 helpers, batch send with retry, and no-network test transports. Provider presets (Hostinger, Gmail, Outlook, Zoho…) make setup one line.

@lacspace/imap

Zero-dependency IMAP4rev1 client for Node (RFC 3501 + IDLE, MOVE, UIDPLUS, CONDSTORE, SPECIAL-USE, LIST-EXTENDED, LITERAL+, SASL-IR, QUOTA, ID). Implicit TLS and STARTTLS with verification on, LOGIN / PLAIN / XOAUTH2 / OAUTHBEARER, streaming byte-accurate parser, async-iterable FETCH, envelopes with RFC 2047 decoding, BODYSTRUCTURE trees shared with @lacspace/mime, modified UTF-7 mailbox names, special-use detection (incl. Gmail XLIST and localised names), IDLE with NOOP fallback. Works with Hostinger (Dovecot), Gmail, Outlook/Exchange, GoDaddy.

@lacspace/mime

Isomorphic RFC 5322 / RFC 2045-2049 MIME parser and builder for webmail. parseMime() turns raw mail (string or bytes) into from/to/cc/subject/date/text/html/attachments/inline cid images/priority/List-Unsubscribe one-click and the part tree; handles nested multipart (mixed, alternative, related, report, signed), message/rfc822 forwards, base64 and quoted-printable (tolerant), RFC 2047 encoded words (split multibyte, adjacent whitespace), RFC 2231 parameters, 30+ charsets and malformed input without ever throwing. parseBodyStructure() parses IMAP BODYSTRUCTURE (literals, extension data) into the same tree with IMAP partIds, plus findTextParts / listAttachments / decodePart for lazy fetching. buildMime() writes CRLF messages with encoded-word headers, QP/base64 bodies, mixed/alternative/related nesting, Message-ID generation and header-injection guards; replyHeaders() / forwardSubject() for threading. Pairs with @lacspace/imap and @lacspace/mailer. Zero dependencies; Node 18+, edge runtimes and browsers.