Michael Naumov17k downloadsAllows to do a lot of things with JavaScript/TypeScript scripts from inside the Obsidian itself
formerly known as
Fix Require Modules, see Rebranding section for more details
This is a plugin for Obsidian that allows to do a lot of things with JavaScript/TypeScript scripts from inside the Obsidian itself.
This plugin is for you if you want to:
JavaScript/TypeScript in:DevTools Console within Obsidian;CustomJS scripts;datacorejs / datacorejsx / datacorets / datacoretsx scripts;dataviewjs scripts;JS Engine scripts;Modules scripts;QuickAdd scripts;Templater scripts;JavaScript/TypeScript syntax and patterns.Obsidian plugins.Obsidian API (public and internal) in runtime easier.JavaScript/TypeScript script via command or hotkey.There are several very good plugins that allow to write JavaScript/TypeScript scripts for Obsidian, but they all have their own limitations and quirks.
Most of those plugins support writing scripts in CommonJS (cjs) only, which is not so used nowadays.
None of those plugins provide you the developer experience as you would have in any other modern JavaScript/TypeScript development environment.
This plugin aims to erase the line between the Obsidian world and the JavaScript/TypeScript development world.
The documentation is a demo vault. Every feature has a note that explains what it does and why you would want it, followed by a button that runs it for real — so you can read the explanation and execute the example in the same place.
Start reading here — it works as plain markdown on GitHub, no installation needed.
To open it in Obsidian and actually click the buttons, use any of:
fix-require-modules-demo-vault-<version>.zip (<version> is the release version) from the Releases.demo-vault/ as a vault.If you are not sure where to start, three notes cover most of it: Core functions (which of require() / requireAsync() / requireAsyncWrapper() to use), Code buttons (runnable snippets inside a note), and Invocable scripts (turning a script into an Obsidian command).
The plugin is available in the official Community Plugins repository.
To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:
Add plugin button once and wait a few seconds for the plugin to install.By default, debug messages for this plugin are hidden.
To show them, run the following command:
window.DEBUG.enable('fix-require-modules');
For more details, refer to the Obsidian Dev Utils debugging guide.
This plugin was formerly known as Fix Require Modules.
The plugin quickly overgrew its original purpose and got way more features than just fixing require() calls. That's why it got a new name.
However, for the backward compatibility, the previous id fix-require-modules is still used internally and you might find it
See my other Obsidian resources.