# easybookjs-lib

> EasyBook shared types, helpers nad other helpful things.

Latest version **1.0.4** (published 2022-04-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install easybookjs-lib
pnpm add easybookjs-lib
yarn add easybookjs-lib
bun add easybookjs-lib
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-04-01 |
| First published | 2022-04-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 37 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tonymontana97 |

## Links

- npm: https://www.npmjs.com/package/easybookjs-lib
- npm.io page: https://npm.io/package/easybookjs-lib

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21

## Recent versions

- 1.0.4 (latest) — 2022-04-01
- 1.0.2 — 2022-04-01
- 1.0.1 — 2022-04-01
- 1.0.0 — 2022-04-01

## README

# Easybook JS Library



## Getting started

This library was created to share code between API and frontend apps.
Library includes: 
- **Types**
- **Helper functions**
- **Libs**

## Day Scheduler
This utils helps you to work day timeline. You can 
build timeline add to this timeline schedule or events. 
You can validate schedule.

### Init Day scheduler
You should init day scheduler and pass required data. \
For example: \
``const dayScheduler = new DayScheduler(schedule);``

### Set day of week to work with
`const dayScheduleMonday = new DayScheduler(schedule).applyDay('Monday')`

### Add events for this day to schedule
`const dayScheduleMondayWithEvents = dayScheduleMonday.applyEvents(events)`

## Can add new event to schedule
`const canAdd = dayScheduleMondayWithEvents.canAddEvent('10:30', 40); // where 40 is duration of event.`

## Get free slots for event in schedule
**duration** - Duration of event in minutes ex. 90 (1h 30m) \
**interval** - Interval for free slots. It will defect diff in free slots starts \
`const freeSlots = dayScheduleMondayWithEvents.getFreeSlots(duration, interval)`

---
_Source: https://npm.io/package/easybookjs-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
