# mealviewerapi

> A lightweight wrapper for the mealviewer API

Latest version **2.0.2** (published 2024-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install mealviewerapi
pnpm add mealviewerapi
yarn add mealviewerapi
bun add mealviewerapi
```

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2024-11-06 |
| First published | 2022-03-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >18 |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | metro420 |
| Maintainers | metro420yt |
| Keywords | mealviewerapi, mealviewer, api, wrapper |

## Links

- npm: https://www.npmjs.com/package/mealviewerapi
- Repository: https://github.com/Metro420yt/MealViewerAPI
- Homepage: https://github.com/Metro420yt/MealViewerAPI#readme
- Issues: https://github.com/Metro420yt/MealViewerAPI/issues
- npm.io page: https://npm.io/package/mealviewerapi

## Recent versions

- 2.0.2 (latest) — 2024-11-06
- 2.0.1 — 2024-11-06
- 2.0.0 — 2022-09-19
- 1.5.1 — 2022-03-14
- 1.5.0 — 2022-03-09
- 1.0.0 — 2022-03-04

## README

> [!WARNING]
> No longer maintained

A lightweight wrapper for the [MealViewer](https://mealviewer.com/) API

Checkout the [examples](/examples) for ideas<br>
Submit your own ideas by creating a pull request

<br>

## Finding your school
Find your school by going to [MealViewer](https://schools.mealviewer.com/) and search for your school.

The url will look like **https://schools.mealviewer.com/school/{YourSchool}**. take {YourSchool}, and put it in the Client constructor.
<br><br>

## Changelog
#### v2.0
- Refactored return object again

``` diff
+ {menu: [{lunch?: {}, etc...}], url?, date?, rawData?}
- {items: [{lunch?: {}, etc...}], url?, date?, rawData?}
```
<br>

- Changed urls
``` diff
+ response.url    => https://schools.mealviewer.com/school/{YourSchool}
- response.url    => https://api.mealviewer.com/api/v4/school/{YourSchool}

+ response.apiURL => https://api.mealviewer.com/api/v4/school/{YourSchool}
```
<br>

- Now using class

``` diff
+ new mv.Client(school, options?).get(date?)
- mv.get(school, date?, options?)
```
<br>

- Daily checking event

``` diff
+ client.daily.on('newMenu', data => {})
```
<br>

- New return array/string to make it clearer what will be returned

``` diff
+ new Client('mySchool', {return: ['date', 'url']})
- new Client('mySchool', {date?, url?})
```
<br>

- More return options

``` diff
+ apiUrl, rawData
```

<br>

- Added menu types for intellisense
- node-fetch dependancy is now set to v2 instead of ^v2
  - mealviewerapi is a CJS project, while node-fetch v3 is an ESM file making v3 unusable with CJS files
- [Code Examples](/examples)

#### v1.5
- get function now accepts start and end date

``` diff
+ mv.get(school, {start?, end?})
```


- refactored return object

``` diff
+ {items: [{lunch?: {}}, etc...], url?, date?, rawData?}
- {lunch?: {}, url?, date?, rawData?}
```

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