Prithvi

JavaScript SDK

If you have not downloaded JavaScript SDK for Prithvi yet, you can download here from here

You're building an e-commerce platform. You need fast access to cart data, session tokens, background job queues, and temporary role-based permissions. Prithvi acts as a blazing-fast, in-memory layer between your Node.js app and disk — fully controllable and persistent when needed. Below is a hands-on walkthrough of all available SDK commands, mapped directly to your application logic.

Terminal

Store a username (e.g., for user profile data).

await client.set("name", "Prithvi")

OK

Set a temporary session token with a TTL of 60 seconds.

await client.set("token", "XYZ", 60)

OK, TTL = 60s

Fetch the stored username.

await client.get("name")

'Prithvi'

Delete a user's expired session token.

await client.del("token")

true

Check if a key (e.g., user profile) exists.

await client.exists("name")

true

List all keys in the store with TTL info.

await client.keys()

['name (TTL: none)']

Add a user to the "devs" set (role management).

await client.sadd("devs", "Boss")

1

Get all users with the "devs" role.

await client.smembers("devs")

['Boss']

Remove a user from the "devs" set.

await client.srem("devs", "Boss")

1

Push a task to the left of a job queue.

await client.lpush("queue", "task1")

1

Add another task to the right of the same queue.

await client.rpush("queue", "task2")

2

Pop the oldest task (left side) from queue.

await client.lpop("queue")

'task1'

Pop the newest task (right side) from queue.

await client.rpop("queue")

'task2'

Check queue state after processing all jobs.

await client.getList("queue")

[]

Attempt to wipe the store (fails unless forced).

await client.flush()

Error: Use flush(true) to confirm

Confirm and flush all in-memory data.

await client.flush(true)

'Store wiped.'

Save the current state to disk (manual snapshot).

await client.save()

'State saved to disk.'

Load the last saved snapshot from disk.

await client.load()

'State loaded from disk.'

Get help and command list (for dev CLI tooling).

await client.help()

Returns list of commands

Gracefully disconnect client (e.g., CLI exit).

await client.quit()

'Goodbye.'

Prithvi

An open-source, Java-based key-value store engineered for speed, simplicity, and developer control.

© 2025 Prithvi — Built with Java | PHILKHANA SIDHARTH