0.3.1 • Published 10 months ago

dbdapi v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

dbdapi

deadbydaylight.comからデータを取得します

インストール

npm install dbdapi

使用例

サバイバーのパーク一覧を取得

import { getCharacters, getCharacter } from "dbdapi"; //import

(async () => {
  const characters = await getCharacters(); //キャラクター一覧を取得
  const survivors = characters.filter((char) => char.role === "survivor"); //サバイバーのみにフィルタ

  const parks = (
    await Promise.all(
      survivors.map(async (surv) => {
        const survivor = await getCharacter(surv.slug, "ja"); //slugからキャラクターの詳細を取得
        return survivor?.powerPerks;
      }),
    )
  ).flat();

  console.log(parks); //表示
})();

注意

このライブラリは非公式で 公式サイト からデータを取得しています
何か問題があった場合には削除します

0.3.0

10 months ago

0.3.1

10 months ago

0.2.1

10 months ago

0.2.0

10 months ago

0.2.2

10 months ago

0.1.0

1 year ago

0.2.1-pre

5 years ago