From 9233e6b7c66fa0d518c3a0320665493beb02ad6e Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 6 Oct 2024 16:29:42 -0400 Subject: [PATCH] Fix npm documentation Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3402 --- platform/nodejs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/nodejs/README.md b/platform/nodejs/README.md index 0b3e3d8c074dc..bd5775abb6de4 100644 --- a/platform/nodejs/README.md +++ b/platform/nodejs/README.md @@ -44,7 +44,7 @@ const { StaticNetFilteringEngine } = await import('@gorhill/ubo-core'); Create an instance of SNFE: ```js -const snfe = StaticNetFilteringEngine.create(); +const snfe = await StaticNetFilteringEngine.create(); ``` Feed the SNFE with filter lists -- `useLists()` accepts an array of @@ -54,8 +54,8 @@ through the `raw` property, and optionally the name of the list through the ```js await snfe.useLists([ - fetch('easylist').then(raw => ({ name: 'easylist', raw })), - fetch('easyprivacy').then(raw => ({ name: 'easyprivacy', raw })), + fetch('easylist').then(r => r.text()).then(raw => ({ name: 'easylist', raw })), + fetch('easyprivacy').then(r => r.text()).then(raw => ({ name: 'easyprivacy', raw })), ]); ```