Cloudkit JS && Node JS
In the browser, CloudKit.js relies on XmlHttpRequest in order to fetch resources, but since CloudKit isn't an npm module you'll need a way to fetch things from your server.
npm install node-fetch
Using node-fetch, here is a tweaked version of your code that logs the resulting Items in your query:
var fetch = require('node-fetch');var CloudKit = require("./cloudkit.js")CloudKit.configure({ services: { fetch: fetch }, containers: [{ containerIdentifier: 'yourContainerIdentifier', apiToken: 'yourAPItoken', environment: 'development' }]})var container = CloudKit.getDefaultContainer();var publicDB = container.publicCloudDatabase;function demoPerformQuery() { publicDB.performQuery({recordType: 'Items'}).then(function(response){ console.log(response) }).catch(function(error){ console.log(error) })}var express = require('express')var app = express()app.get("/", function() { demoPerformQuery()})var server = app.listen(8080, function () { console.log("Server listen")})
After hitting http://localhost:8080 you should see your server log the response to your query.