Discussion
Loading...

#Tag

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp last month

🥳 JavaScript Database (JSDB) version 6.1.4 released:

• Adds TypeScript type definitions

Been meaning to do this for a while and finally got round to it :)

https://codeberg.org/small-tech/jsdb#javascript-database-jsdb

#JavaScript #database #JavaScriptDatabase #JSDB #native #data #web #dev #NodeJS #SmallWeb

  • Copy link
  • Flag this post
  • Block
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp 2 months ago

Ah, the joys of having a built-in native JavaScript database¹ that can persist and load typed JavaScript objects² and an interactive JavaScript shell (REPL)³ in Kitten⁴ :)

:kitten:💕

¹ https://kitten.small-web.org/reference/#database
² https://kitten.small-web.org/tutorials/database-app-modules/
³ https://kitten.small-web.org/reference/#kitten-s-interactive-shell-repl
⁴ https://kitten.small-web.org

#Kitten #SmallWeb #web #development #JavaScript #NodeJS #JSDB

Screenshot of the Kitten shell open in terminal for the currently-running site:

> kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al')

Proxy [
Account {


id: 'ce4c1f2c-2044-47a0-b97e-1bc1a43bfc07',

url: 'https://mastodon.ar.al/@aral',

isVerified: true,

data: Proxy [ [Object], [Object] ],

isScheduled: false,

joinPageIp: undefined,

privatePageIps: Proxy [ [Array], [Object] ],

isTeam: false,

callDays: Proxy [ [Array], [Object] ]
}
get: [Function: bound getHandler], set: [Function: bound setHandler], defineProperty: [Function: bound definePropertyHandler], deleteProperty: [Function: bound deletePropertyHandler]
}
]

> kitten.db.calendar.scheduleInterview(kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al').id)
Screenshot of the Kitten shell open in terminal for the currently-running site: > kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al') Proxy [ Account { id: 'ce4c1f2c-2044-47a0-b97e-1bc1a43bfc07', url: 'https://mastodon.ar.al/@aral', isVerified: true, data: Proxy [ [Object], [Object] ], isScheduled: false, joinPageIp: undefined, privatePageIps: Proxy [ [Array], [Object] ], isTeam: false, callDays: Proxy [ [Array], [Object] ] } get: [Function: bound getHandler], set: [Function: bound setHandler], defineProperty: [Function: bound definePropertyHandler], deleteProperty: [Function: bound deletePropertyHandler] } ] > kitten.db.calendar.scheduleInterview(kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al').id)
Screenshot of the Kitten shell open in terminal for the currently-running site: > kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al') Proxy [ Account { id: 'ce4c1f2c-2044-47a0-b97e-1bc1a43bfc07', url: 'https://mastodon.ar.al/@aral', isVerified: true, data: Proxy [ [Object], [Object] ], isScheduled: false, joinPageIp: undefined, privatePageIps: Proxy [ [Array], [Object] ], isTeam: false, callDays: Proxy [ [Array], [Object] ] } get: [Function: bound getHandler], set: [Function: bound setHandler], defineProperty: [Function: bound definePropertyHandler], deleteProperty: [Function: bound deletePropertyHandler] } ] > kitten.db.calendar.scheduleInterview(kitten.db.accounts.findAccountWithHandle('@aral@mastodon.ar.al').id)
  • Copy link
  • Flag this post
  • Block
Aral Balkan
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp 11 months ago

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) :)

https://kitten.small-web.org/reference/#kitten-s-interactive-shell-repl

(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⁶.)

¹ https://small-tech.org
² https://sitejs.org
³ https://gohugo.io/
⁴ https://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 https://kitten.small-web.org/reference/#sessions-and-authentication).
⁶ https://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] }
    }
  ]
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] } } ]
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] } } ]
Codeberg.org

jsdb

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

Kitten: Reference

Kitten: Reference

  • Copy link
  • Flag this post
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct