A JavaScript library for interacting with KLE JSON and KLE data structures.
Originally ported from keyboard-layout-editor with improvements to make the source code increasingly portable across different language platforms.
To view documentation, examples, visit the documentation site.
To install and use the library, choose an installation method listed below.
npm install @damsenviet/kle
yarn add @damsenviet/kle
<!-- available under the global namespace 'kle' -->
<script src="https://unpkg.com/@damsenviet/kle"></script>
This quick start demo demonstrates parsing a KLE JSON.
const fs = require('fs');
const path = require('path');
const { Keyboard } = require('@damsenviet/kle');
// relative to this file
const jsonRelativePath = './keyboard.json';
const jsonAbsolutePath = path.join(__dirname, jsonRelativePath);
const keyboardJson = JSON.parse(fs.readFileSync(jsonAbsolutePath, 'utf-8'))
const keyboard = Keyboard.fromJSON(keyboardJson);
for (const key of Keyboard.keys) {
for (const label of key.labels) {
// pass
}
}
The schemas for KLE JSON can be found at kle-json.
There are many ways to contribute to this project.
For more information please see the contributing guidelines.
Generated using TypeDoc