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

saizeriya

v0.8.0

Published

サイゼリヤのメニューを取得する Node.js ライブラリ

Downloads

149

Readme

saizeriya

npm version build codecov License

Overview

サイゼリヤのメニューを取得する Node.js ライブラリ

Notes

インストール

npm install saizeriya

使用方法

import { Saizeriya } from "saizeriya";

const saizeriya = new Saizeriya();

// 全てのメニューを取得
const menus = saizeriya.all();

// 条件を指定してメニューを取得
const filteredMenus = saizeriya.all({
  priceMin: 500,
  genres: ["パスタ"],
});

// カテゴリを取得
const categories = saizeriya.categories();

// ジャンルを取得
const genres = saizeriya.genres();

// 旧ジャンルを取得
const preGenres = saizeriya.preGenres();

// 特定のIDに対応するメニューを取得
const menu = saizeriya.getById(1);

// 特定の旧IDに対応するメニューを取得
const preMenu = saizeriya.getByPreId("DG01");

// ランダムなメニューの組み合わせを取得
const randomMenus = saizeriya.random();

メソッド

all(params?: SaizeriyaMenuParams): Menu[]

条件に合う全てのメニューの一覧を取得します。

引数

  • params(オプション): フィルタリング条件

レスポンス

  • Menu[]: メニューの配列

categories(): Category[]

全てのカテゴリを取得します。

レスポンス

  • Category[]: カテゴリの配列

genres(): Genre[]

全てのジャンルを取得します。

レスポンス

  • Genre[]: ジャンルの配列

getById(id: number): Menu | undefined

指定した ID に対応するメニューを取得します。

引数

  • id: メニューの ID

レスポンス

  • Menu: メニューオブジェクト。見つからない場合はundefined

random(params?: SaizeriyaMenuParams, maxSum: number = 1000, allowDuplicates: boolean = true,): RandomMenus

指定した総額に対応するランダムなメニューの組み合わせを取得します。

引数

  • params: フィルタリングの条件
  • maxSum: 総額の上限 (デフォルト: 1000)
  • allowDuplicates: 重複許容フラグ (デフォルト: true)

レスポンス

  • RandomMenus: ランダムなメニューの組み合わせオブジェクト。

型定義

SaizeriyaMenuParams

| パラメータ | 型 | 説明 | | ----------------- | -------- | ---------------------------- | | priceMin | number | 税抜価格 (最小) | | priceMax | number | 税抜価格 (最大) | | priceWithTaxMin | number | 税込価格 (最小) | | priceWithTaxMax | number | 税込価格 (最大) | | categories | string[] | カテゴリ名 | | name | string | メニュー名 | | calorieMin | number | エネルギー (最小) | | calorieMax | number | エネルギー (最大) | | saltMin | number | 食塩相当量 (最小) | | saltMax | number | 食塩相当量 (最大) | | genres | string[] | ジャンル名 | | excludedMenuIds | number[] | 除外するメニュー ID | | excludeAlcohol | boolean | アルコール類を除外するフラグ |

Menu

| フィールド | 型 | 説明 | サンプル | | -------------- | ------- | ---------------------------- | ---------------- | | id | number | メニュー ID | 1202 | | name | string | メニュー名 | 小エビのサラダ | | nameEn | string | メニュー名(英語) | Shrimp Salad | | nameZh | string | メニュー名(中国語) | 小甜虾沙拉 | | price | number | 税抜価格 | 319 | | priceWithTax | number | 税込価格 | 350 | | calorie | number | エネルギー (カロリー) (kcal) | 192 | | salt | number | 食塩相当量 (g) | 1.5 | | genre | Genre | ジャンル名 | サラダ | | category | string | カテゴリ名 | グランド | | categoryEn | string | カテゴリ名(英語) | Grand Menu | | categoryZh | string | カテゴリ名(中国語) | | | isAlcohol | boolean | アルコールフラグ | false | | icon | string | アイコン (絵文字) | 🍤 | | preId | string | 旧メニュー ID | SA02 |

Category

| フィールド | 型 | 説明 | サンプル | | ------------ | ------ | -------------------- | ------------ | | category | string | カテゴリ名 | グランド | | categoryEn | string | カテゴリ名(英語) | Grand Menu | | categoryZh | string | カテゴリ名(中国語) | |

Genre

string: ジャンル名

RandomMenus

| フィールド | 型 | 説明 | | ------------------- | ------ | -------------------------- | | menus | Menu[] | 組み合わせ内のメニュー一覧 | | totalSalt | number | 食塩相当量の総額 | | totalCalorie | number | エネルギーの総額 | | totalPriceWithTax | number | 税込価格の総額 |

Link

  • https://github.com/ryohidaka/saizeriya-menus

License

This project is licensed under the MIT License - see the LICENSE file for details.