
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
obsidian-text-extract
Advanced tools
Work In Progress - Use with care, seriously.
A library, designed for Obsidian plugins, to extract text from PDFs and images. It works by sharing a common cache and pool of workers between all library users.
It is currently used in Omnisearch
Since extracting text from PDFs and images takes a lot of resource, the main idea of this library is to make a globally available pool of workers, shared among all Obsidian plugins that wish to use it. As such, it is important to not change the namespace or indexedDB database name. Doing so would put an unnecessary strain on Obsidian that could crash it, and more generally will waste the device's resources. Be responsible.
First, install it with a fixed version:
"dependencies": {
"obsidian-text-extract": "1.0.3"
}
(Yes I messed up with npm, and submitted the first version as 1.0.0
. Sorry.)
To use it:
import { getPdfText, getImageText } from 'obsidian-text-extract'
async function getTextFromFile(
file: TFile
): Promise<string> {
let content: string
if (file.path.endsWith('.pdf')) {
content = await getPdfText(file)
} else if (file.path.endsWith('.png')) {
content = await getImageText(file)
}
return content
}
Text extraction does not work on mobile; calling the functions will just immediately return an empty string.
You'll need Rust, wasm-pack, and pnpm.
$ pnpm i
$ pnpm run build
Rust is quite slow to compile, so the first build will take some time.
FAQs
> Work In Progress - Use with care, seriously.
The npm package obsidian-text-extract receives a total of 2 weekly downloads. As such, obsidian-text-extract popularity was classified as not popular.
We found that obsidian-text-extract demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.