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

dnf-api

v0.5.22

Published

던전 앤 파이터 API

Downloads

6

Readme


목차


설치

npm 으로 설치할 경우

npm install dnf-api

yarn 으로 설치할 경우

yarn add dnf-api

사용법

소스 상단에 dnf-dnfApi 를 호출하신 뒤 사용하실 수 있습니다. 혹은 ES5 문법 사용시 아래의 형태로 호출 하실 수 있습니다.

import dnfApi from "dnf-api";
//or
var dnfApi = require("dnf-api");

//required
dnf.Config.key = "YOUR API KEY";

//optional
dnf.Config.hideOnErrorApiKey = true;
dnf.Config.hidekeyText = { HIDEKEY };
dnf.Config.axiosTimeout = 5000;

//아래에 소스코드를 작성합니다.

서버정보

던전앤 파이터 서버 정보를 불러옵니다.

서버목록애 대한 정보는 이곳을 참고해주세요.

let { error, data } = await dnf.Api.Server.List();
if (error) consola.error(error);
else {
  consola.info(data);
}

캐릭터

던전 앤 파이터 게임내 캐릭터에 관련된 API 입니다.

캐릭터 검색

캐릭터를 닉네임으로 검색하여 받아옵니다.

let { error, data } = await dnf.Api.Characters.characterName(dnf.ServerNames.anton, "쑤남");
if (error) console.error(error);
else {
  console.info(data);
}

캐릭터 기본 정보

캐릭터에 대한 기본적인 정보를 받아옵니다.

dnfApi.characters.characterId("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

타임라인 정보

캐릭터 ID 에 대한 타임라인 정보를 받아옵니다.

타임라인 코드에 대한 정보는 이곳에서 확인하실 수 있습니다.

let opt = {
  limit: 10,
};
dnfApi.characters.timeline("cain", "d018e5f7e7519e34b8ef21db0c40fd98", opt).then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

능력치 정보

dnfApi.characters.status("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

캐릭터 장비

장착 장비 정보

dnfApi.characters.equip.equipment("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

장착 아바타 정보

dnfApi.characters.equip.avatar("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

장착 크리쳐 정보

dnfApi.characters.equip.creature("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

장착 휘장 정보

dnfApi.characters.equip.flag("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

버프 스킬 강화 (스위칭)

스위칭 장착 장비

dnfApi.characters.skill.equipment("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

스위칭 장착 아바타

dnfApi.characters.skill.avatar("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

스위칭 장착 크리처

dnfApi.characters.skill.creature("cain", "d018e5f7e7519e34b8ef21db0c40fd98").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

경매장

경매장 등록 아이템 검색 (이름)

let opt = {
  sort: dnfApi.config.auction.sort.unitPrice,
  limit: 10,
  wordType: dnfApi.config.auction.wordType.match,
};
let query = {
  minLevel: 1,
  maxlevel: 10,
  rarity: dnfApi.config.auction.query.rarity.rare,
};
dnfApi.auction.itemName("마그토늄", opt).then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

경매장 등록 아이템 조회 (경매장 등록 번호)

dnfApi.auction.no("670998412").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

아이템

아이템 검색

dnfApi.items.item("마그토늄").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

아이템 상세 정보

dnfApi.items.detail("c6a38ab8c7540cfc51ea2b0b8b610fa7").then((data) => {
  if (data.err) return console.log(data.err);
  console.log(data);
});

직업

직업 정보

dnfApi.jobs().then((data) => {
  console.log(data);
});

세트 아이템

세트 아이템 검색

let opt = {
  limit: 2,
  wordType: dnfApi.config.setitems.wordType.front,
};
dnfApi.setitems.setitem("오감", opt).then((data) => {
  console.log(data);
});

세트 아이템 상세 정보

dnfApi.setitems.detail("040d72e3585ea068f2d85fee654dab20").then((data) => {
  console.log(data);
});