Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bin/qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# Detect the runtime used to install this package and use the matching one
# to avoid native module ABI mismatches (e.g., better-sqlite3 compiled for bun vs node)

DIR="$(cd "$(dirname "$0")/.." && pwd)"

# Check if we were installed with bun (look for bun.lock or bun-lockb)
if [ -f "$DIR/bun.lock" ] || [ -f "$DIR/bun.lockb" ] || [ -n "$BUN_INSTALL" ]; then
exec bun "$DIR/dist/qmd.js" "$@"
else
exec node "$DIR/dist/qmd.js" "$@"
fi
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "Query Markup Documents - On-device hybrid search for markdown files with BM25, vector search, and LLM reranking",
"type": "module",
"bin": {
"qmd": "dist/qmd.js"
"qmd": "bin/qmd"
},
"files": [
"bin/",
"dist/",
"LICENSE",
"CHANGELOG.md"
Expand Down