#JavaScriptDatabase

2025-05-26

šŸ‘‹šŸ¤“ Goodbye Site.js, Hello Kitten!

I started working on creating a Small Web¹ server (a peer-to-peer Web server) six years ago² with Site.js.

Building Site.js was my first attempt. And it resulted in:

• Auto Encrypt (automatic Let’s Encrypt certificates): codeberg.org/small-tech/auto-e

• Auto Encrypt Localhost (automatic localhost TLS certificates): codeberg.org/small-tech/auto-e

• @small-tech/https (drop-in Node.js https module replacement with automatic TLS certs everywhere): codeberg.org/small-tech/https

• JSDB: In-process, in-memory JavaScript database that persists to append-only JavaScript logs: codeberg.org/small-tech/jsdb

As Site.js reached an evolutionary dead-end, and as I learned from my experiements with replicated data types that replicated data types are *not* a prerequisite for a decentralised web (actual topological decentralisation and ease of use are), I started writing a new server/platform called Kitten from scratch while still making use of the tried and tested modules listed above.

Last week, I switched over our last site using Site.js to Kitten and, with that, today I’ve sunset³ Site.js:

sitejs.org

For its successor, please see Kitten:

kitten.small-web.org

If you want to support our work at the Small Technology Foundation, please consider becoming a patron:

small-tech.org/fund-us

:kitten:šŸ’•

¹ ar.al/2024/06/24/small-web-com
² ar.al/2019/08/26/introducing-s
³ Using our instance of Look Over There!: look-over-there.small-web.org

#SiteJS #SmallWeb #SmallTech #peerToPeerWeb #SmallTechnologyFoundation #AutoEncrypt #AutoEncryptLocalhost #JSDB #JavaScriptDatabase #https #TLS

Detail of Site.js web site:
Illustation of woman lying down with laptop. On screen is a twig with two green leaves.

Site.js
Small Web construction set.
Site.js is deprecated and no longer being actively maintained. Much of it lives on in Kitten.
2025-05-14

šŸ”’ New Kitten & JSDB Releases

Security fix, JSDB 6.0.1.

This is a critical update.

• JSDB¹ versions 6.0.0 and below suffer from potential data corruption/arbitrary code execution as string keys were not being sanitised in the same way string values were² (so this is relevant to you if you’re storing untrusted data as keys in your data structures in JSDB and/or Kitten databases without carrying out any of your own sanitisation at the application level).

• The latest Kitten release uses JSDB version 6.0.1. Your deployment servers will automatically update in the next few hours. On your development machines, please run `kitten update` in your terminal or use the Update feature in Kitten Settings from your browser.

• If you are using Kitten’s Database App Modules³ feature in your apps, you will have installed JSDB manually and you should update your installation to version 6.0.1.

¹ codeberg.org/small-tech/jsdb/
² codeberg.org/small-tech/jsdb/i
³ kitten.small-web.org/reference

#Kitten #SmallWeb #JSDB #JavaScriptDatabase #KittenRelease #JSDBRelease #securityUpdate #criticalUpdate

2025-04-17

New Kitten release

• Fixes #236¹: The data preview pages in Kitten’s settings how handle circular references in the deserialised data (which may contain your custom classes if that’s what you were persisting in the database).

kitten.small-web.org

:kitten:šŸ’•

PS. Those pages are very rudimentary at the moment and are good for getting quick visual overview of the data you’re persisting. For a fully interactive view, use Kitten’s interactive shell (REPL)² to explore your data until I’ve had a chance to implement a more comprehensive visual interface.

PPS. You persist data in Kitten using the built-in JavaScript Database (JSDB)³ (Or, of course, you can install and use any other database.)

¹ codeberg.org/kitten/app/issues
² kitten.small-web.org/reference
³ codeberg.org/small-tech/jsdb#j

#Kitten #SmallWeb #update #changes #database #JavaScriptDatabase #JSDB #javascript #nodeJS #web #dev

2025-02-10

Your web server having an interactive shell (REPL) where you can live update entries in your site/app’s database is pretty neat (if I do say so myself) :)

kitten.small-web.org/reference

(I’m porting the Small Technology Foundation site¹ from Site.js² – and hence from being a static site generated via Site.js’s integrated Hugo³ – to Kitten⁓. In the process, I’m creating an admin panel⁵ for the news, events, and videos sections, which will make them easier to update, and storing the data in Kitten’s internal JavaScript Database⁶.)

¹ small-tech.org
² sitejs.org
³ gohugo.io/
⁓ kitten.small-web.org
⁵ It’s trivial to create authenticated routes in Kitten. You just add a lock emoji (šŸ”’) to the end of your route’s name. e.g., adminšŸ”’.page.js or /adminšŸ”’/index.page.js (see kitten.small-web.org/reference).
⁶ codeberg.org/small-tech/jsdb

#Kitten #REPL #shell #JavaScript #database #JavaScriptDatabase #JSDB #SmallTechnologyFoundation #SiteJS #Hugo #web #dev #NodeJS

Screenshot of Kitten’s interactive shell, showing me alterning a database entry in development:

}
  ]

🐱 šŸ’¬ kitten.db.news[0].link = kitten.db.news[0].postLink

  'https://ar.al/2024/05/23/new-kitten-features-interactive-shell-repl-multi-page-settings-and-backup-and-restore-data-portability/'

🐱 šŸ’¬ kitten.db.news[0]

  Proxy [
    News {
      link: 'https://ar.al/2024/05/23/new-kitten-features-interactive-shell-repl-multi-page-settings-and-backup-and-restore-data-portability/',
      title: 'New Kitten features: Interactive Shell (REPL), Multi-page Settings, and backup and restore (data portability)',
      date: '2024-05-23',
      image: '',
      summary: 'In this video, Aral demonstrates the new features added to Kitten in May: including the new Interactive Shell (REPL), Multi-page Settings, and backup and restore (data portability).',
      author: 'Aral Balkan',
      sourceName: 'Aral’s Blog',
      sourceLink: 'https://ar.al',
      postLink: 'https://ar.al/2024/05/23/new-kitten-features-interactive-shell-repl-multi-page-settings-and-backup-and-restore-data-portability/',
      presets: 'custom'
    },
    {
      get: [Function: bound getHandler] { boundObject: [DataProxy] },
      set: [Function: bound setHandler] { boundObject: [DataProxy] },
      defineProperty: [Function: bound definePropertyHandler] { boundObject: [DataProxy] },
      deleteProperty: [Function: bound deletePropertyHandler] { boundObject: [DataProxy] }
    }
  ]
2025-02-10

Just updated the Database App Modules tutorial in the Kitten documentation to fix a few bugs, update to latest Kitten syntax, and improve the instructions:

kitten.small-web.org/tutorials

(Database app modules are special app modules¹ that let you create strongly-typed JavaScript databases² in your Small Web³ apps.)

Enjoy!

:kitten:šŸ’•

¹ kitten.small-web.org/reference
² codeberg.org/small-tech/jsdb#r
³ ar.al/2024/06/24/small-web-com

#Kitten #DatabaseAppModules #AppModules #tutorial #SmallWeb #SmallTech #web #dev #JSDB #JavaScriptDatabase #JavaScript #database #web #dev #NodeJS #strongTyping

2024-05-06

Just published a minor update (version 5.1.1) to JavaScript Database (JSDB) that optimises the custom data type¹ serialisation code by removing a redundant return statement:

npmjs.com/package/@small-tech/

This change is backwards compatible and shouldn’t require and updates to your projects, including the ones you have in Kitten (which uses JSDB internally).

¹ codeberg.org/small-tech/jsdb#c
² codeberg.org/kitten/app

#JavaScriptDatabase #JavaScript #database #JSDB #Kitten #SmallWeb #NodeJS #web #dev

2024-05-02

JSDB 5.1.0 published¹ šŸŽ‰

• Forgetting to pass a custom class that’s persisted in your database in your `JSDB.open()` call now throws instead of corrupting your database by falling back to using an untyped object.

• Added JSDF ver. 2 to 3 database migration script (i.e., JSDB version 2-4 to 5)²

To install update:

npm install @small-tech/jsdb@5.1.0

¹ codeberg.org/small-tech/jsdb/r

² codeberg.org/small-tech/jsdb#v

#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev

2024-05-01

JSDB 5.0.1 published šŸŽ‰

• Fixes #14: Crash if DataProxy getHandler() called on object with null prototype. (codeberg.org/small-tech/jsdb/i)

To install update:

npm install @small-tech/jsdb@5.0.1

Learn more about JSDB:

codeberg.org/small-tech/jsdb#j

#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev

2024-05-01

To really drive home the above šŸ‘† point that 100% test coverage does not mean ā€˜bug free’, just found a bug in JSDB¹ 5.0.0 where running JSON.stringify() on a complex custom object (actually: the automatic Proxy of the custom object created by JSDB) results in an error.

Already have a failing test and about to implement fix.

(It’s at this point where the test harness is invaluable.)

¹ codeberg.org/small-tech/jsdb

#JavaScriptDatabase #JavaScript #database #JSDB #JSDB5 #NodeJS #SmallWeb #SmallTech

2023-09-05

Kitten¹ now keeps two JSDB² databases per project: an internal one ('kitten._db`) that holds data Kitten manages (sessions, uploads, etc.) and the default one (`kitten.db`) that holds your own tables.

You’ll mostly only care about the latter.

I also took the opportunity to create a Database App Module example and document it in the readme:

codeberg.org/kitten/app#databa

¹ codeberg.org/kitten/app
² codeberg.org/small-tech/jsdb

#Kitten #SmallWeb #web #dev #database #JavaScriptDatabase #jsdb

2023-08-21

It’s so cool to be able to tail your database (append-only JavaScript log¹) when playing with Kitten².

(If I do say so myself.)

The output on the right is the initial state of running the following command on your project folder to tail the domains table when the project is being served on the domain dev.ar.al:

kitten db tail domains --domain=dev.ar.al --all

:kitten: šŸ’•

¹ codeberg.org/kitten/app#using-
² codeberg.org/kitten/app#kitten

#Kitten #SmallWeb #JavascriptDatabase #JSDB #js #web #dev

Screenshot of two terminal windows, side-by-side on a wide screen. The one on the left has Kitten running, serving Domain at dev.ar.al.

On the right is the output from the kitten db tail domains --domain=dev.ar.al --all command showing a formatted data structure with entries like the following:

"test-20230819-2012": {
    "subdomain": "test-20230819-2012",
    "domain": "small-web.org",
    "setup": {
      "complete": false,
      "hasError": false,
      "state": "place-is-reachable",
      "startedAt": "2023-08-18T19:12:56.685Z",
      "endedAt": "2023-08-18T19:13:41.511Z"
    },
    "server": {
      "token": "9f4b873e7e329e33f452d3488f52a1b95981695e57e27f6144791bea24092a67",
      "id": 36134233,
      "createdAt": "2023-08-18T19:12:57.000Z"
    },
    "application": {
      "name": "Place",
      "source": "https://codeberg.org/small-web/place.git"
    },
    "dns": {
      "id": 46789068
    }
  }
2023-05-30

Just published Kitten’s¹ new database² commands:

- kitten db [table name] to see info the database/a specific table
- kitten db delete [table name] to delete the database/a specific table
- kitten db tail <table name> to follow a specific table

Full docs: codeberg.org/kitten/app#databa

¹ codeberg.org/kitten/app
² codeberg.org/small-tech/jsdb

#Kitten #SmallWeb #SmallTech #JavaScriptDatabase #javascript #database #JSDB #web #dev #js #NodeJS #commandLineInterface #CLI

2023-05-06

An interesting JavaScript Database (JSDB) edge case I just encountered:

If you’re persisting custom objects, please do NOT use setter methods (`set something () {…}`).

Use regular methods instead (`setSomething () {…}`) for predictable behaviour that likely matches your conceptual model of how things should work.

(This is due to how setters interact with proxies.)

Details: codeberg.org/small-tech/jsdb#c

#JavaScriptDatabase #javascript #database #jsdb #accessors #SmallTech #SmallWeb #web #dev

2022-09-06

JavaScript Database (JSDB) version 2.0.6 (ESM) and 1.2.3 (CJS) released.

Fixed:

- Crash when key contains single quote
- npm warnings

Install:

ESM: npm i @small-tech/jsdb
CJS: npm i @small-tech/jsdb@cjs

(JSDB is a zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.)

Learn more: codeberg.org/small-tech/jsdb#j

#JavaScriptDatabase #JSDB #SmallTech #SmallWeb #database #dev #web #js #NodeJS #JavaScript

2020-10-31

JSDB version 1.1.5 released

• Attempt to create a query on a non-array object now throws TypeError.

To install: npm i @small-tech/jsdb

Introductory blog post/tutorial: ar.al/2020/10/20/introducing-j

Source code: github.com/small-tech/jsdb

#JSDB #JavaScriptDatabase #SmallTech #SmallWeb #JavaScript #database

2020-10-29

JSDB version 1.1.4 released

This is a bugfix release: Object keys containing non-alphanumeric characters are now properly supported.

(Thanks to @djsundog for the bug report.)

To install: npm i @small-tech/jsdb

Introductory blog post/tutorial: ar.al/2020/10/20/introducing-j

Source code: github.com/small-tech/jsdb

#JSDB #JavaScriptDatabase #SmallTech #SmallWeb #JavaScript #database

2020-10-28

JSDB version 1.1.3 released

This release improves query security by failing faster during sanitisation of disallowed characters and on syntax errors (the latter by using the function constructor instead of eval.)

To install: npm i @small-tech/jsdb

Introductory blog post/tutorial: ar.al/2020/10/20/introducing-j

Source code: github.com/small-tech/jsdb

#JSDB #JavaScriptDatabase #JavaScriptQueryLanguage #JSQL #SmallTech #SmallWeb #JavaScript #database #security

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst