QMK Firmware のリポジトリに登録されているキーボードのリストを取得する方法
API が公開されているので、それを利用すればリストを取得することができる。
以下のコードは、API を叩いてキーボードのデータを取得し、それを String.prototype.split() メソッドを使って keyboardList 変数に配列として格納して返している。
code:js
function generateKeyboardList() {
.then(response => {
if (!response.ok) {
throw new Error('Response not success.');
}
return response.text();
})
.then(data => {
const keyboardList = data.split(',');
return keyboardList;
})
.catch(error => console.error('There has been a problem with your fetch operation:', error));
}