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)); })(); ```