1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-10-01 22:49:09 +00:00
conky/web/utils/search-serde.ts

10 lines
331 B
TypeScript
Raw Normal View History

2024-02-26 18:18:49 +00:00
import * as fs from 'fs/promises'
import { createSearchIndex } from './search'
export async function writeSearchIndex() {
await fs.mkdir('public').catch(() => {})
await fs.mkdir('public/static').catch(() => {})
const index = createSearchIndex()
await fs.writeFile('public/static/fuse-index.json', JSON.stringify(index))
}