From d34dcf01747bb90b63fc9008cd832a1c7f1eea07 Mon Sep 17 00:00:00 2001 From: Edoardo Scibona <12040076+velut@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:42:45 +0100 Subject: [PATCH] docs: update readme --- README.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d66ff2a..c2c3f87 100644 --- a/README.md +++ b/README.md @@ -34,14 +34,8 @@ It downloads packages from the npm registry and analyzes them to extract their p import { extractPackageApi } from "@jsdocs-io/extractor"; (async () => { - const result = await extractPackageApi({ pkg: "preact" }); - if (result.isOk()) { - const packageApi = result.value; // Successfully extracted API - console.log(JSON.stringify(packageApi, null, 2)); - } else { - const extractorError = result.error; // Error extracting API - console.error(extractorError); - } + const packageApi = await extractPackageApi({ pkg: "preact" }); + console.log(JSON.stringify(packageApi, null, 2)); })(); ``` @@ -52,13 +46,7 @@ import { extractPackageApi } from "@jsdocs-io/extractor"; (async () => { const result = await extractPackageApi({ pkg: "preact", subpath: "hooks" }); - if (result.isOk()) { - const packageApi = result.value; // Successfully extracted API - console.log(JSON.stringify(packageApi, null, 2)); - } else { - const extractorError = result.error; // Error extracting API - console.error(extractorError); - } + console.log(JSON.stringify(packageApi, null, 2)); })(); ```