From f9666ea05d71e6d4861b2ecb4a13ed1a5595db16 Mon Sep 17 00:00:00 2001 From: Esteban Laver <10552966+emlaver@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:43:04 -0500 Subject: [PATCH] docs: update imports in README examples to ES stype --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 95571a437..d368fe587 100644 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ createDb.then(() => { JavaScript: ```js -const { CloudantV1 } = require('@ibm-cloud/cloudant'); +import { CloudantV1 } from "@ibm-cloud/cloudant"; ``` [embedmd]:# (test/examples/src/js/CreateDbAndDoc.js /const createDbAndDoc/ /createDbAndDoc\(\);\n\}/) ```js @@ -526,7 +526,7 @@ client.getDocument(getDocParams).then((documentExample) => { JavaScript: ```js -const { CloudantV1 } = require('@ibm-cloud/cloudant'); +import { CloudantV1 } from "@ibm-cloud/cloudant"; ``` [embedmd]:# (test/examples/src/js/GetInfoFromExistingDatabase.js /const getInfoFromExistingDatabase/ /getInfoFromExistingDatabase\(\);\n\}/) ```js @@ -700,7 +700,7 @@ client JavaScript: ```js -const { CloudantV1 } = require('@ibm-cloud/cloudant'); +import { CloudantV1 } from "@ibm-cloud/cloudant"; ``` [embedmd]:# (test/examples/src/js/UpdateDoc.js /const updateDoc/ /updateDoc\(\);\n\}/) ```js @@ -880,7 +880,7 @@ client JavaScript: ```js -const { CloudantV1 } = require('@ibm-cloud/cloudant'); +import { CloudantV1 } from "@ibm-cloud/cloudant"; ``` [embedmd]:# (test/examples/src/js/DeleteDoc.js /const deleteDoc/ /deleteDoc\(\);\n\}/) ```js @@ -1124,7 +1124,7 @@ const changesFollower: ChangesFollower = new ChangesFollower( JavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; ``` [embedmd]:# (test/examples/src/features/js/initialize.js /const client/ $) ```js @@ -1170,7 +1170,7 @@ const changesItemsStream: Stream = changesFollower.start(); JavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; ``` [embedmd]:# (test/examples/src/features/js/start.js /const client/ $) ```js @@ -1211,7 +1211,7 @@ const changesItemsStream: Stream = changesFollower.startOneOf JavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; ``` [embedmd]:# (test/examples/src/features/js/startOneOff.js /const client/ $) ```js @@ -1284,9 +1284,9 @@ pipeline(changesItemsStream, destinationStream) JavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); -const { Writable } = require('node:stream'); -const { pipeline } = require('node:stream/promises'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; +import { Writable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; ``` [embedmd]:# (test/examples/src/features/js/startAndProcess.js /const client/ $) ```js @@ -1403,9 +1403,9 @@ async function getChangesFromFollower(changesItemsStream: StreamJavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); -const { Writable } = require('node:stream'); -const { pipeline } = require('node:stream/promises'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; +import { Writable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; ``` [embedmd]:# (test/examples/src/features/js/startOneOffAndProcess.js /const client/ $) ```js @@ -1521,9 +1521,9 @@ setTimeout(() => { JavaScript: ```js -const { ChangesFollower, CloudantV1 } = require('@ibm-cloud/cloudant'); -const { Writable } = require('node:stream'); -const { pipeline } = require('node:stream/promises'); +import { ChangesFollower, CloudantV1 } from '@ibm-cloud/cloudant'; +import { Writable } from 'node:stream'; +import { pipeline } from 'node:stream/promises'; ``` [embedmd]:# (test/examples/src/features/js/stop.js /const client/ $) ```js