
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
cloudstate-darwin-arm64
Advanced tools
Cloudstate is a JavaScript database runtime. It is a foundational component of Freestyle's full stack JavaScript hosting.
[!TIP] Try out cloudstate via a freestyle template. Read our getting started guide to learn more.
[!IMPORTANT] If you find a bug in cloudstate, the fastest way you can get it fixed is by contributing a failing JavaScript test. See our testing for js developers guide.
If you're interested in learning more about how cloudstate works behind the scenes, read on.
You can install the cloudstate cli alongside the freestyle cli. Run npm install -g freestyle-sh@beta or you can build it from source.
cloudstate run ./script.jsThe lowest level way to store data in cloudstate is via the cloudstate run command. You can use the global setRoot function with an id and object to store data.
const object = {
counter: 0,
};
setRoot("test-root", object);
To retrieve an object from the database, call getRoot and pass in the identifier you used to store the object.
const object = getRoot("test-root");
If you have multiple references to the same object, those references will be preserved. The values of each property are also lazy loaded, so you don't need to worry about the complexity of objects stored in a single setRoot call.
const obj = {};
const objects = {
a: obj,
b: obj,
};
setRoot("objects", objects);
const objects = getRoot("objects");
objects.a === objects.b; // true
cloudstate serve ./script.jsA more structured way to store data in cloudstate is via the cloudstate serve command. Instead of writing what the script should execute, you write classes. When you put a static id on a class, it will be automatically constructed and stored using setRoot for you. Methods will be exposed as endpoints which you can call via http.
export class CounterCS {
static id = "counter";
count = 0;
increment() {
return ++this.count;
}
}
curl -X POST http://localhost:3000/cloudstate/instances/counter/increment -H "Content-Type: application/json" -d '{"params": []}'
npx freestyle devThe highest level api is built into freestyle's dev tooling. You can define classes anywhere in a full stack project using a decorator and they be automatically compiled into a single file and served.
import { cloudstate } from "freestyle-sh";
@cloudstate
class CounterCS {
static id = "counter";
count = 0;
increment() {
return ++this.count;
}
}
Then you can easily query that data using useCloud.
import { type CounterCS } from "./schema.js";
import { useCloud } from "freestyle-sh";
const counter = useCloud<typeof CounterCS>("counter");
await counter.increment();
To learn more read the freestyle docs.
FAQs
Cloudstate
We found that cloudstate-darwin-arm64 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.