fixup! diigo-cache: RSS in diigo's export shape, from cached items
compare-export.ts: as a program script, its @file is its manual (purpose, usage, outputs, exit code), per docs-files-api's exception; main's JSDoc keeps only the edge and attenuation. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
2bb18a9e96
commit
9c99f4f969
1 file changed
+14
-12
@@ -1,5 +1,15 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
/** @file program script: does a cache hold everything in a diigo RSS export? See {@link main}. */
|
/**
|
||||||
|
* @file program script: does a cache hold everything in a diigo RSS export?
|
||||||
|
*
|
||||||
|
* node scripts/compare-export.ts <cache.sqlite> <export.xml> <out-dir>
|
||||||
|
*
|
||||||
|
* Generates RSS from the cache's items (src/rss.ts) and compares it with
|
||||||
|
* the export, keyed on link: title, tags, description, highlights and
|
||||||
|
* sticky notes. Prints counts to stdout; writes <out-dir>/from-cache.rss
|
||||||
|
* and <out-dir>/report.json (mismatched links, by category). Exits 2 on
|
||||||
|
* bad usage.
|
||||||
|
*/
|
||||||
import * as nodeFs from "node:fs/promises";
|
import * as nodeFs from "node:fs/promises";
|
||||||
import { basename, join } from "node:path";
|
import { basename, join } from "node:path";
|
||||||
import { DatabaseSync } from "node:sqlite";
|
import { DatabaseSync } from "node:sqlite";
|
||||||
@@ -100,19 +110,11 @@ export function outDir(fs: Pick<typeof nodeFs, "writeFile">, dir: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates RSS from a cache's items (src/rss.ts) and compares it with a
|
* the program's edge (ocap discipline, transitional form): takes the
|
||||||
* diigo RSS export: title, tags, description, highlights + sticky notes.
|
|
||||||
*
|
|
||||||
* node scripts/compare-export.ts <cache.sqlite> <export.xml> <out-dir>
|
|
||||||
*
|
|
||||||
* Prints counts to stdout; writes <out-dir>/from-cache.rss and
|
|
||||||
* <out-dir>/report.json (mismatched links, by category).
|
|
||||||
*
|
|
||||||
* The program's edge (ocap discipline, transitional form): it takes the
|
|
||||||
* standard authorities as default arguments and attenuates them here —
|
* standard authorities as default arguments and attenuates them here —
|
||||||
* the database to {@link cacheItems}, the output directory to
|
* the database to {@link cacheItems}, the output directory to
|
||||||
* {@link outDir} — before anything else uses them. Ends by reporting an
|
* {@link outDir} — before anything else uses them; reports the exit code
|
||||||
* exit code (2: usage) through `exit`.
|
* through `exit`
|
||||||
*/
|
*/
|
||||||
export async function main(
|
export async function main(
|
||||||
argv = process.argv.slice(2),
|
argv = process.argv.slice(2),
|
||||||
|
|||||||
Reference in new issue
Block a user