# CustomJS plugin for Obsidian CustomJS, created by Sam Lewis and maintained by saml-dev, loads JavaScript classes from files or folders in the vault and exposes their instances globally inside [[Obsidian]]. Write a class once, and every scripting surface in the app can call its methods: [[Dataview plugin for Obsidian|Dataview]] queries, DataviewJS blocks, [[Templater plugin for Obsidian|Templater]] templates, QuickAdd macros, and even hotkey-bound invocations of a specific method. This is the shared-library pattern for scripted vaults. Without it, logic gets copy-pasted into every template and query that needs it; with it, formatting helpers, frontmatter accessors, task-collection logic, or API wrappers live in one file, and a fix there propagates everywhere. Scripts can also be marked to run at startup, giving the vault an initialization hook. The classes are plain JavaScript files stored inside the vault, so they sync between devices with the notes and can be versioned with the rest of the vault. For anyone whose Obsidian setup has grown into a real software system — dashboards, generated notes, cross-note computations — CustomJS is the piece that keeps that system maintainable. ## References - Download: https://obsidian.md/plugins?id=customjs - Source code: https://github.com/saml-dev/obsidian-custom-js