Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mnaoumov/obsidian-backlink-cache
Obsidian Backlink Cache Plugin
https://github.com/mnaoumov/obsidian-backlink-cache
Last synced: about 1 month ago
JSON representation
Obsidian Backlink Cache Plugin
- Host: GitHub
- URL: https://github.com/mnaoumov/obsidian-backlink-cache
- Owner: mnaoumov
- License: mit
- Created: 2023-09-10T23:34:47.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-04T03:39:19.000Z (3 months ago)
- Last Synced: 2024-10-14T14:08:01.287Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 321 KB
- Stars: 20
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Backlink Cache
This is a plugin for [Obsidian](https://obsidian.md/) that maintains backlink cache to speed up undocumented `app.metadataCache.getBacklinksForFile` function.
It's mostly useful for users with the large vaults. On smaller vaults the difference might be unnoticeable.
It speeds up `Backlinks Pane` performance and plugins that deal with the backlinks.
This plugin the most likely will be useful for other plugin developers that deal with the backlinks.
Its idea came from the [forum](https://forum.obsidian.md/t/store-backlinks-in-metadatacache/67000).
## Usage
### Fast version
The provided version is faster than the built-in version. Also the overload to accept `path` was added.
```js
const backlinks1 = app.metadataCache.getBacklinksForFile(file);
const backlinks2 = app.metadataCache.getBacklinksForFile(path);
```### Safe version
If you want to ensure the all recent file changes are processed and the backlinks are 100% accurate.
```js
const backlinks1 = await app.metadataCache.getBacklinksForFile.safe(file);
const backlinks2 = await app.metadataCache.getBacklinksForFile.safe(path);
```### Original version
You can access the original built-in version:
```js
const backlinks = app.metadataCache.getBacklinksForFile.originalFn(file);
```### TypeScript typings
If you want to use the updated functions from your plugin, you can copy [types.d.ts](./types.d.ts) into your code.
## Installation
- `Backlink Cache` is available in [the official Community Plugins repository](https://obsidian.md/plugins?id=backlink-cache).
- Beta releases can be installed through [BRAT](https://obsidian.md/plugins?id=obsidian42-brat).## Support
## License
© [Michael Naumov](https://github.com/mnaoumov/)