Skip to content

JY8752/shellscript-zx-bun-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

シェルスクリプトとzx(Bun)の比較

簡単なスクリプトをシェルスクリプトとzxで書き比べてみる。せっかくなのでJSのランタイムにはBunを使ってみる。

スクリプトの内容

あらかじめ、配置したデータをもとにガチャのシュミレーションを実行するスクリプト。データには以下の2ファイルを配置しスクリプト内で読み込んでいる。

  • themes.txt 有効なガチャテーマの一覧。
theme1 これはtheme1のガチャです
theme2 これはtheme2のガチャです
theme3 これはtheme3のガチャです
  • gacha/<theme number>.csv 各ガチャテーマに含まれるアイテム情報。
id,name,rarity,weight
1,item1,N,10
2,item2,N,10
3,item3,N,10
4,item4,N,10
5,item5,N,10
6,item6,R,5
7,item7,R,5
8,item8,R,5
9,item9,R,5
10,item10,SR,1

シェルスクリプトの実行

./main.sh

Demo main.sh

zx(Bun)

setup

init

% bun init

module

  • zx ^7.2.3
  • inquirer ^9.2.11
  • papaparse ^5.4.1
bun add zx inquirer papaparse

zxスクリプトの実行

./index.ts

Demo index.ts

About

シェルスクリプトとbun x zxの比較検証

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published