# In Obsidian TypeScript, how do I call an async function from a synchonous function?

**URL:** <https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245>\
**Category:** Devs: Plugins & API\
**Created:** [August 12, 2026, 2:32am UTC](https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245 "2026-08-12T02:32:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinellison](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/0ea827/32.png) [@martinellison](https://forum.obsidian.md/u/martinellison)\
**Post date:** [August 12, 2026, 2:32am UTC](https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245/1 "2026-08-12T02:32:49Z")

</div>

I am writing a plugin in TypeScript for the Obsidian notetaking app (PC and mobile). I have functions that are triggered by Commands and Events (which are synchronous) and I would like to update Note files (and these API calls are all async/await).

Is there any kind of async runner that would let me do this?

Note: worker threads will not work as they run in their own address space.

Also, node is only available on PC (for Obsidian).

---

<div class="post-metadata">

**Author:** ![Zachatoo](https://forum.obsidian.md/user_avatar/forum.obsidian.md/zachatoo/32/24205_2.png) [@Zachatoo](https://forum.obsidian.md/u/Zachatoo)\
**Post date:** [August 13, 2026, 2:26pm UTC](https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245/2 "2026-08-13T14:26:47Z")

</div>

You shouldn’t need any sort of dedicated async runner, it should “just work”, are you experiencing issues with calling async functions from a sync context? Can you provide an example?

---

<div class="post-metadata">

**Author:** ![Hesprs](https://forum.obsidian.md/user_avatar/forum.obsidian.md/hesprs/32/88786_2.png) [@Hesprs](https://forum.obsidian.md/u/Hesprs)\
**Post date:** [August 15, 2026, 11:47am UTC](https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245/3 "2026-08-15T11:47:19Z")

</div>

This is TypeScript basics, to run an asynchronous operation in a synchronous context, use:

```TypeScript
void asyncOperation(); // asyncOperation() returns a Promise

```

This is equivalent to `asyncOperation()` directly without `void`, but `void` satisfies linters.

Promise lifecycle tracking:

```TypeScript
void asyncOperation().then(/* ... */);
void asyncOperation().catch(/* ... */);
void asyncOperation().finally(/* ... */);

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [November 10, 2026, 9:11am UTC](https://forum.obsidian.md/t/in-obsidian-typescript-how-do-i-call-an-async-function-from-a-synchonous-function/117245/4 "2026-11-10T09:11:24Z")

</div>

Closed on November 10, 2026, 9:11am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
