npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

karabiner-human-config

v0.15.0

Published

The easiest way to write Karabiner-Elements configuration files, ever!

Downloads

130

Readme

Karabiner-Human-Config

The easiest way to write Karabiner-Elements configuration files, ever!

npm npm GitHub

Find it on the official website of Karabiner-Elements at external JSON generators.

Creating configuration files for Karabiner-Elements can be challenging. With Karabiner-Human-Config (KHC), you can effortlessly generate your own configuration files using human-readable/understandable syntax.

Usage

Just create a new konfig.json file:

{
  // direct
  "caps": { "t": "hyper", "a": "100 caps" },
  "hyper spacebar": "cmd spacebar",
  // group
  "fn": {
    "_self": { "t": "fn", "a": "cmd tab" },
    "spacebar": "cmd spacebar",
    "v": "$ open -a 'Visual Studio Code'"
  },
  // application group
  "Visual Studio Code": {
    "fn tilde": "ctrl tilde"
  }
}

And run the following command:

npx karabiner-human-config

And voila! From 10-15 lines to 170+ lines of configuration in just a few seconds.

The generated configuration will be saved in karabiner.json in the same directory.

Bonus: If you wish to checkout my personal configuration, you can find it here. And what it generates here.

Table of Contents

CLI Usage

Version:
  [email protected]

Usage:
  $ karabiner-human-config [options]

Options:
  -i, --input    Input file path (default: konfig.json)
  -o, --output   Output file path (default: karabiner.json)
  -v, --version  Display version number
  -h, --help     Display help message

Author:
  Neeraj Dalal <[email protected]> (https://nrjdalal.com)

With Default Options

npx karabiner-human-config

With Custom Input and Output

You can use either/both of the options.

npx karabiner-human-config -i konfig.json -o karabiner.json

Types of Addressing

Comments

Don't hold back on the comments. They are your best friend. KHC will strip them out before generating the configuration.

Direct Keys

Use string values if there's only to event. In case of multiple events, use object values. Read more at specifying multiple events.

{
  "hyper spacebar": "cmd spacebar",
  "caps": { "t": "hyper", "a": "100 caps" }
}

Group Keys

Instead of repeating the same key beginning, use group keys.

{
-  "fn": { "t": "fn", "a": "cmd tab" },
-  "fn spacebar": "cmd spacebar",
-  "fn v": "$ open -a 'Visual Studio Code'",
+  "fn": {
+    "_self": { "t": "fn", "a": "cmd tab" },
+    "spacebar": "cmd spacebar",
+    "v": "$ open -a 'Visual Studio Code'"
+  }
}

Note: Currently, _self is required to create a group key.

Application Group Keys

Use application names if you want to specify key mappings for a specific application. Don't worry about finding bundle identifiers, just use the app name.

{
  "Visual Studio Code": {
    "fn tilde": "ctrl tilde"
  }
}

Advanced Usage for From Events

Optional Modifiers

Use | to specify optional modifiers.

{
-  "fn spacebar: "cmd spacebar"
+  "fn spacebar | any": "cmd spacebar"
}

Advanced Usage for To Events

Shell Command

Use $ to specify a shell command.

{
-  "fn spacebar": "cmd spacebar"
+  "fn spacebar": "$ open -a 'Google Chrome'"
}

Prefix Delay and Flags

Prefix with lazy, repeat, halt to set flags. Or number to specify a delay.

{
-  "fn spacebar": "cmd spacebar"
+  "fn spacebar": "100 lazy repeat halt cmd spacebar"
}

Specify Multiple Events

Instead of strings, use objects like { to: ..., to_if_alone: ... } to specify multiple to events.

{
-  "fn spacebar": "cmd spacebar"
+  "fn": { "to": "fn", "to_if_alone": "cmd tab" }
}

Conditions

Add Karabiner conditions like device_if, device_unless, input_source_if, variable_if, keyboard_type_if, and more.

Per-Manipulator Conditions

Use c (or conditions) to add conditions to a single manipulator.

{
  "caps": {
    "t": "escape",
    "c": [{ "type": "device_if", "identifiers": [{ "vendor_id": 1452 }] }]
  }
}

Group-Level Conditions

Use _conditions inside a group with _self to apply conditions to all manipulators in the group.

{
  "rcmd": {
    "_self": "rcmd",
    "_conditions": [
      {
        "type": "device_unless",
        "identifiers": [{ "is_built_in_keyboard": true }]
      }
    ],
    "d": "$ open \"https://discord.com\""
  }
}

Both rcmd (self) and rcmd d will have the device_unless condition applied.

Conditions-Only Groups

Use _conditions without _self to scope conditions to a group of keys without a shared modifier.

{
  "external_keyboard": {
    "_conditions": [
      {
        "type": "device_if",
        "identifiers": [{ "vendor_id": 1234, "product_id": 5678 }]
      }
    ],
    "a": { "t": "b" },
    "caps": { "t": "escape" }
  }
}

The group key (external_keyboard) is just a label — child keys are processed as-is with the conditions inherited.

Note: _conditions also works inside application group keys to combine device conditions with app-specific conditions.

Alias

Custom Aliases

  • hyper for left_command left_control left_option left_shift
  • left_command as cmd lcmd l_cmd left_cmd lcommand l_command

Check and add custom-aliases.ts for more.

Manipulator Key's Aliases

  • t for to
  • a for to_if_alone
  • h for to_if_held_down
  • c for conditions

Check and add manipulator-keys.ts for more.

Future Considerations

  • You tell me, I just got to know about Karabiner-Elements two days before publishing this on Feb 07, 2025.