Search
Items tagged with: NodeJS
The Evergreen Web section in Kitten’s¹ settings now has its own page too (and uses Kitten’s new Streaming HTML² workflow).
If you have the previous version of your site up somewhere, you can use the 404-to-307 technique³ to forward missing pages to your old site so as not to break the Web.
I’ll add local static archive support later.
¹ https://codeberg.org/kitten/app
² https://ar.al/2024/03/08/streaming-html/
³ https://4042307.org
#Kitten #SmallWeb #EvergreenWeb #StreamingHTML #web #dev #NodeJS #JavaScript
Streaming HTML
Sorry, your browser doesn't support embedded videos. But that doesn’t mean you can’t watch it! You can download the video and watch it with your favourite video player. Building the Streaming HTML counter example.Aral Balkan
This is a niche one but it might help someone in the future:
How to include multiple directories from different places in the file system hierarchy in an archive without including the whole directory structure for any of them.
TL; DR: use symlinks.
#NodeTar #NodeJS #tar #prefixes #directory #hierarchy #flat #archive
gists/how-to-include-multiple-directories-from-different-places-in-the-file-system-hierarchy-in-an-archive-without-including-the-whole-directory-structure-for-any-of-them.md at main
gists - A place for me to post and share small, self-contained code snippets.Codeberg.org
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:
https://www.npmjs.com/package/@small-tech/jsdb
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).
¹ https://codeberg.org/small-tech/jsdb#custom-data-types
² https://codeberg.org/kitten/app
#JavaScriptDatabase #JavaScript #database #JSDB #Kitten #SmallWeb #NodeJS #web #dev
Just deployed a new Kitten¹ version 🎉
• Adds database backup and restore in your app’s Kitten settings page (/💕/settings)
• Upgrades version of JSDB from 4 to 5²
• You can emit and listen for events on the session object you get from `request.session` in your routes now.
¹ https://codeberg.org/kitten/app
² For migration notes, please see: https://codeberg.org/small-tech/jsdb#migrating-from-earlier-versions-of-jsdf
#Kitten #backupAndRestore #JavaScript #NodeJS #database #JSDB #sessions #SmallWeb #web #dev
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
¹ https://codeberg.org/small-tech/jsdb/releases
² https://codeberg.org/small-tech/jsdb#version-2-to-3
#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
JSDB 5.0.1 published 🎉
• Fixes #14: Crash if DataProxy getHandler() called on object with null prototype. (https://codeberg.org/small-tech/jsdb/issues/14)
To install update:
npm install @small-tech/jsdb@5.0.1
Learn more about JSDB:
https://codeberg.org/small-tech/jsdb#javascript-database-jsdb
#JavaScriptDatabase #JavaScript #database JSDB #JSDB5 #NodeJS #SmallTech #SmallWeb #web #dev
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
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.)
¹ https://codeberg.org/small-tech/jsdb
#JavaScriptDatabase #JavaScript #database #JSDB #JSDB5 #NodeJS #SmallWeb #SmallTech
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
JSDB 5.0.0 published 🎉
• Custom classes must have a `constructor` that accepts a parameter object as its only argument. Constructors are run during deserialisation.
• Custom classes can now safely extend other classes (e.g., `EventEmitter`).
• Properties that begin with an underscore (`_`) are treated as private and ignored.
• Objects with null prototypes are supported. i.e., objects created with `Object.create(null, …)`.
Full details: https://codeberg.org/small-tech/jsdb#migrating-from-earlier-versions-of-jsdf
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org
Realised last night that JavaScript Database (JSDB) doesn’t run the constructor on persisted custom objects (https://codeberg.org/small-tech/jsdb#custom-data-types) when deserialising them because I didn’t know that you apparently have to define your constructor manually when using Object.create().
Will fix it today but it’s something to watch out for if you’re using Object.create() directly.
For more info, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
#JSDB #customObjects #constructor #bug #JavaScript #NodeJS #SmallTech #SmallWeb
jsdb
A zero-dependency, transparent, in-memory, streaming write-on-update JavaScript database for the Small Web that persists to a JavaScript transaction log.Codeberg.org