Quite simply, combine an enchanted item with a plain book (matched against either normal books or the ore dictionary entry for "book"), and for a configurable experience cost (default of 2 levels per enchantment currently on the item being unenchanted), take a book enchanted with the first enchant on the item from the anvil.
Left behind will be the original item, either completely unenchanted (or with any remaining enchantments), and with your book stack restored.
If interested, you can now support my modding work on Patreon.
Currently, quite experimental! This can technically be done regardless of the "repair cost too high", although it does not reduce the repair cost on the original item.
Example:
Patreon & Discord
You can support me on Patreon!
All support for this mod is available on my Discord. You can also keep up with what I'm doing and get notifications streams!
For all other support, please hit "Issues" at the top of this page.