LoginSignup
4
1

次世代JavaScriptランタイム「Bun」でNode-REDを動かしてみた

Posted at

はじめに

Software Design 2024年6月号の第2特集で次世代JavaScriptランタイムBunが取り上げられていました。
ITエンジニア必須の最新用語解説「WinterJS」でも「Bun」が取り上げられていて、どれくらい高速化
高速化されたか気になり、さっそくNode-REDで試してみた。

インストール

Node.jsの場合、管理ソフトウェア(nvm(Node Version Manager))やインストールするバージョンを気にする必要がありましたが、Bunの場合は気にする必要がありません。

 curl -fsSL https://bun.sh/install | bash

バージョン確認

bun -v
1.1.12

動作確認

Node-REDのインストール

bun init -y
bun install node-red
bun ./node_modules/node-red/red.js -u ./

立ち上げやモジュールのロード時間が短くなったことを体感できました。
メニュー → パレットの管理 → モジュールの追加(node-red-dashboard)で、インストールも早いです。

スクリーンショット 2024-06-02 17.50.34.png

2 Jun 17:40:49 - [info] 

Welcome to Node-RED
===================

2 Jun 17:40:49 - [info] Node-RED バージョン: v3.1.9
2 Jun 17:40:49 - [info] Node.js  バージョン: v22.2.0
2 Jun 17:40:49 - [info] Darwin 23.5.0 arm64 LE
2 Jun 17:40:49 - [info] パレットノードのロード
2 Jun 17:40:49 - [info] 設定ファイル: /Users/kitazaki/tmp/20240602/settings.js
2 Jun 17:40:49 - [info] コンテキストストア : 'default' [module=memory]
2 Jun 17:40:49 - [info] ユーザディレクトリ : /Users/kitazaki/tmp/20240602
2 Jun 17:40:49 - [warn] プロジェクトは無効化されています : editorTheme.projects.enabled=false
2 Jun 17:40:49 - [info] フローファイル     : /Users/kitazaki/tmp/20240602/flows.json
2 Jun 17:40:49 - [info] flow ファイルを作成します
2 Jun 17:40:49 - [warn] 

---------------------------------------------------------------------
フローのクレデンシャルファイルはシステム生成キーで暗号化されています。

システム生成キーを何らかの理由で失った場合、クレデンシャルファイルを
復元することはできません。その場合、ファイルを削除してクレデンシャルを
再入力しなければなりません。

設定ファイル内で 'credentialSecret' オプションを使って独自キーを設定
します。変更を次にデプロイする際、Node-REDは選択したキーを用いてクレ
デンシャルを再暗号化します。 

---------------------------------------------------------------------

2 Jun 17:40:49 - [warn] 暗号化されたクレデンシャルが存在しません
2 Jun 17:40:49 - [info] フローを開始します
2 Jun 17:40:49 - [info] フローを開始しました
2 Jun 17:40:49 - [info] サーバは http://127.0.0.1:1880/ で実行中です
2 Jun 17:41:09 - [info] フローを停止します
2 Jun 17:41:09 - [info] フローを停止しました
2 Jun 17:41:09 - [info] フローを更新しました
2 Jun 17:41:09 - [info] フローを開始します
2 Jun 17:41:09 - [info] フローを開始しました
2 Jun 17:41:18 - [info] フローを停止します
2 Jun 17:41:18 - [info] フローを停止しました
2 Jun 17:41:18 - [info] フローを更新しました
2 Jun 17:41:18 - [info] フローを開始します
2 Jun 17:41:18 - [info] フローを開始しました
2 Jun 17:41:44 - [info] モジュール node-red-dashboard, バージョン: 3.6.5 をインストールします
2 Jun 17:41:47 - [info] モジュール node-red-dashboard をインストールしました
2 Jun 17:41:47 - [info] Dashboard version 3.6.5 started at /ui
2 Jun 17:41:47 - [info] 追加したノード:
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_base
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_button
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_dropdown
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_switch
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_slider
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_numeric
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_text_input
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_date_picker
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_colour_picker
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_form
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_text
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_gauge
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_chart
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_audio
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_toast
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_ui_control
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_template
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_link
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_tab
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_group
2 Jun 17:41:47 - [info]  - node-red-dashboard:ui_spacer
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1