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 🙏

© 2026 – Pkg Stats / Ryan Hefner

genshin-crafter

v0.1.2

Published

Genshin Inventory Crafter

Readme

Mechanism

First, calculate the items in the same class Afterwards, each 11 crafting procedure is performed and the final value is returned.

우선 같은 등급에서 재화를 계산합니다. 이후 총 11번의 합성 절차를 거친 후 값을 리턴합니다. |procedure|Before|After| |------|---|---| |5star <-- 4star|0,3,0,0|1,0,0,0| |4star <-- 3star|0,0,3,0|0,1,0,0| |5star <-- 3star|0,0,9,0|1,0,0,0| |3star <-- 2star|0,0,0,3|0,0,1,0| |4star <-- 2star|0,0,0,9|0,1,0,0| |5star <-- 2star|0,0,0,27|1,0,0,0| |5star <-- 3star + 4star|0,2,3,0|1,0,0,0| |5star <-- 2star + 3star|0,0,8,3|1,0,0,0| |5star <-- 2star + 4star|0,2,0,9|1,0,0,0| |4star <-- 2star + 3star|0,0,2,3|0,1,0,0| |5star <-- 2star + 3star + 4star|0,2,2,3|1,0,0,0|

Install

installing via npm

npm으로 설치 및 사용

npm install genshin-crafter

Usage

You can use only 1 function. Make sure the arrays are correctly aligned starting from 5star to 2star. If the number of item's class is not 4 but 3, you can put 0 value in 5star.

함수는 아래 하나만 쓰시면 됩니다. 배열은 5성에서 2성 순으로 만드시면 됩니다. 만일 아이템 등급이 총 3개라면 5성 부분에 0을 넣으시면 됩니다.

const possess = { 5: 0, 4: 0, 3: 3, 2: 112 } // 보유한 아이템
const target = { 5: 6, 4: 9, 3: 0, 2: 0 } // 목표 아이템
const result = craftify ( { possess }, { target } );

return value may like below

리턴값은 아래와 같이 나옵니다

count : {5: 5star up, 4: 4star up, 3: 3star up},
remain : { remained } ,
required : { required }
requiredTotal : required item totals

Example

const result = craftify ({5: 0, 4: 0, 3: 1, 2: 112}, {5: 6, 4: 9, 3: 0, 2: 0});
console.log(result.count); // 1,12,36
console.log(result.remain); // 0,0,1,4
console.log(result.required); // 5,0,0,0
console.log(result.requiredTotal); // 128
const result = craftify ({5: 6, 4: 0, 3: 11, 2: 0}, {5: 6, 4: 9, 3: 9, 2: 1});
console.log(result.count); // 0,0,0
console.log(result.remain); // 0,0,2,0
console.log(result.required); // 0,9,0,1
console.log(result.requiredTotal); // 76
// App.tsx (React)
import "./App.css";
import craft from "genshin-crafter";

function App() {
  const input = {
    5: 0,
    4: 0,
    3: 3,
    2: 112,
  };
  const target = {
    5: 6,
    4: 9,
    3: 0,
    2: 0,
  };

  const testCraft = craft(input, target);

  return (
    <>
      <main
        style={{
          display: "flex",
          flexDirection: "column",
          gap: "10px",
          justifyContent: "center",
          alignItems: "start",
          padding: "2rem",
        }}
      >
        <h1>My Items</h1>
        <div style={{ display: "flex", flexDirection: "row", gap: "10px" }}>
          <a>5star: {input["5"]}</a>
          <a>4star: {input["4"]}</a>
          <a>3star: {input["3"]}</a>
          <a>2star: {input["2"]}</a>
        </div>

        <h1>Target Items</h1>
        <div style={{ display: "flex", flexDirection: "row", gap: "10px" }}>
          <a>5star: {target["5"]}</a>
          <a>4star: {target["4"]}</a>
          <a>3star: {target["3"]}</a>
          <a>2star: {target["2"]}</a>
        </div>
        <h1>Required Items</h1>
        <div style={{ display: "flex", flexDirection: "row", gap: "10px" }}>
          <a>5star: {testCraft.required["5"]}</a>
          <a>4star: {testCraft.required["4"]}</a>
          <a>3star: {testCraft.required["3"]}</a>
          <a>2star: {testCraft.required["2"]}</a>
        </div>

        <h1>Total craft Counts</h1>
        <div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
          <a>4star &gt;&gt; 5star: {testCraft.count["5"]}</a>
          <a>3star &gt;&gt; 4star: {testCraft.count["4"]}</a>
          <a>2star &gt;&gt; 3star: {testCraft.count["3"]}</a>
        </div>

        <h1>Needed</h1>
        <div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
          <a>Total Needed 2star: {testCraft.requiredTotal}</a>
        </div>

        <h1>Progress</h1>
        <div style={{ display: "flex", flexDirection: "column", gap: "10px" }}>
          <a>
            {(testCraft.requiredTotal /
              (target['2'] + target['3'] * 3 + target['4'] * 9 + target['5'] * 27)) *
              100}
            %
          </a>
        </div>
      </main>
    </>
  );
}