Bring the power of the open source project to your browser or node.js project. Get information on keyboards and layouts and even compile firmware using the QMK API.
Using yarn (recommended):
yarn add qmk
Or with npm:
npm install --save qmk
Get metadata for keyboards using the QMK Keyboard API
import QMK from 'qmk';
// Create an API client using the provided version
const client = new QMK('v1');
const keyboardName = 'massdrop/alt';
// Fetch keyboard metadata
client.keyboards(keyboardName).then(({ keyboards }) => {
// The "keyboards" call always returns a dictionary of keyboards
// So we keep keyboardName to reference it in the response body
console.info(keyboards[keyboardName]);
}).catch((err) => {
console.error(err);
});
Get metadata for every supported QMK keyboard using the special all
keyword
import QMK from 'qmk';
// Create an API client using the provided version
const client = new QMK('v1');
// Fetch keyboard metadata
client.keyboards('all').then(({ keyboards }) => {
console.info(keyboards);
}).catch((err) => {
console.error(err);
});
Check out more usage examples in the examples directory
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.