From 93d7fdf38d5bfa1a77b8444bee489cecf5e2befa Mon Sep 17 00:00:00 2001 From: Peter Saxton Date: Fri, 28 Jul 2023 22:39:27 +0200 Subject: [PATCH] make examples execute in order --- cozo-lib-nodejs/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cozo-lib-nodejs/README.md b/cozo-lib-nodejs/README.md index 92bcadd7..0909743c 100644 --- a/cozo-lib-nodejs/README.md +++ b/cozo-lib-nodejs/README.md @@ -24,14 +24,14 @@ const {CozoDb} = require('cozo-node') const db = new CozoDb() function printQuery(query, params) { - db.run(query, params) + return db.run(query, params) .then(data => console.log(data)) .catch(err => console.error(err.display || err.message)) } -printQuery("?[] <- [['hello', 'world!']]") -printQuery("?[] <- [['hello', 'world', $name]]", {"name": "JavaScript"}) -printQuery("?[a] <- [[1, 2]]") +await printQuery("?[] <- [['hello', 'world!']]") +await printQuery("?[] <- [['hello', 'world', $name]]", {"name": "JavaScript"}) +await printQuery("?[a] <- [[1, 2]]") ``` ### Basic API @@ -136,4 +136,4 @@ If you did everything correctly, you should get the hello world message printed node example.js ``` -under this directory. \ No newline at end of file +under this directory.