{"id":25535975,"url":"https://github.com/nicolaeiotu/dbindjs","last_synced_at":"2026-02-09T19:09:28.335Z","repository":{"id":26383463,"uuid":"108206181","full_name":"NicolaeIotu/dbindjs","owner":"NicolaeIotu","description":"Data Binding for Javascript","archived":false,"fork":false,"pushed_at":"2024-12-06T10:58:39.000Z","size":713,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T18:05:29.378Z","etag":null,"topics":["bind","binding","data","data-binding","databind","dbind","dbindjs","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicolaeIotu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-25T01:54:34.000Z","updated_at":"2024-12-06T10:55:19.000Z","dependencies_parsed_at":"2025-02-20T04:37:27.213Z","dependency_job_id":null,"html_url":"https://github.com/NicolaeIotu/dbindjs","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":0.56,"last_synced_commit":"20a2072baabc3cc59fdf4fade83f8505a12baae7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolaeIotu%2Fdbindjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolaeIotu%2Fdbindjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolaeIotu%2Fdbindjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicolaeIotu%2Fdbindjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicolaeIotu","download_url":"https://codeload.github.com/NicolaeIotu/dbindjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248419817,"owners_count":21100254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bind","binding","data","data-binding","databind","dbind","dbindjs","javascript"],"created_at":"2025-02-20T04:24:40.583Z","updated_at":"2026-02-09T19:09:23.312Z","avatar_url":"https://github.com/NicolaeIotu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Actions Status](https://github.com/NicolaeIotu/dbindjs/workflows/CI/badge.svg)\n![Actions Status](https://github.com/NicolaeIotu/dbindjs/workflows/Coverage/badge.svg)\n\n# dbindjs\n\n**dbindjs** is data binding for Javascript.\n\n\n`import { dbind } from 'dbindjs'`\n\n\n* [Run in Browser](#run-in-browser)\n* [Examples](#examples)\n    * [Basic dbindjs](#basic-dbindjs)\n    * [Neural networks with dbindjs](#neural-networks-with-dbindjs)\n* [Others](#others)\n\n## Run in Browser\nProbably the easiest way to make **dbindjs** run in browser is to upload the file *dist/dbindjs.js* to the scripts' location of your webserver and use a standard import as follows:\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    ...\n  \u003c/head\u003e\n  \u003cbody\u003e\n      \u003cscript type=\"module\"\u003e\n        import { dbind } from './scripts/dbindjs.js'\n        // ...\n      \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Examples\nA couple of examples are provided here below. For more see \n\u003ca href=\"https://github.com/NicolaeIotu/dbindjs/tree/main/examples\" title=\"examples folder on GitHub\"\u003eexamples folder on GitHub\u003c/a\u003e and \n\u003ca href=\"https://github.com/NicolaeIotu/dbindjs/tree/main/docs\" title=\"docs folder on GitHub\"\u003edocs folder on GitHub\u003c/a\u003e.\n\n### Basic dbindjs\n\n```\nimport { dbind } from 'dbindjs'\n\ndbind({\n  // Property, Basic\n  // when the value of this property changes, the bindings depending on it automatically update\n  a: 1,\n\n  // Property, Basic\n  b: 1,\n\n  // Binding, Basic\n  // defines a binding relation (which may include internal bindings) within the pool,\n  // and uses results outside of the pool\n  c: function () {\n    // use references to basic properties of the binding pool\n    const dep = this.d()\n    const inrc = this.a / this.b / dep\n    console.log(inrc)\n\n    // use result somewhere else outside of the binding pool\n    // ...\n  },\n\n  // Binding, Internal\n  // defines a binding relation which is used by other bindings in the binding pool\n  d: function () {\n    const inrd = this.a + this.b + this.f\n    console.log(inrd)\n\n    // output for other bindings\n    return inrd\n  },\n\n  // Binding, Complex\n  // defines a binding relation (which may include internal bindings) within the pool,\n  // uses results outside of the pool\n  // and can be used by other bindings in the binding pool\n  e: function () {\n    // use references to basic properties of the binding pool\n    const dep = this.d()\n    const inre = this.a + this.b + this.f + dep\n    console.log(inre)\n\n    // use result somewhere else outside of the binding pool\n    // ...\n\n    // output for other bindings\n    return inre\n  },\n\n  // Binding, Basic\n  f: 2\n  // ...\n  // ...\n})\n\n// trigger the bindings by changing the values of some dependencies\ndbind({ a: 23, f: 45 })\n```\n\n### Neural networks with dbindjs\nThis example simulates a **fully** connected neural network of `maxNeurons` 'neurons' \n(100000). The number of 'neurons' can be increased or decreased to match testing \nmachine capabilities. When using the default value (100000 'neurons'), the example \nshould run pretty fast on a standard personal computer.\n\nChanges to any components of this network trigger propagation to all 'neurons'.\n\nAll sorts of actions can be triggered. This example prints a result if 'neuron' \ndata meets a certain condition.\n```\nimport { dbind } from 'dbindjs'\n\nconst maxNeurons = 100000\nconst miniBrain = {}\nfor (let i = 0; i \u003c maxNeurons; i++) {\n  miniBrain['n' + i] = {\n    synapseFiringTrigger: 0,\n    neuronData: {\n      a: Math.random() * 100,\n      b: Math.random() * 100000\n    },\n    // important! remember fat arrow functions loose 'this',\n    // so don't use them with dbindjs binding functions\n    act: function () {\n      if (this.neuronData.a \u003e this.neuronData.b) {\n        console.log('n' + i + ': ', this.neuronData)\n      }\n      // alter data in order to create randomness for the next calls\n      // this.neuronData.a = Math.random() * 100\n      // this.neuronData.b = Math.random() * 100000\n    }\n  }\n}\n\nconst desc = {\n  action1: function () {\n    for (const prop in this) {\n      if (miniBrain.hasOwnProperty(prop) \u0026\u0026 miniBrain[prop].hasOwnProperty('act')) {\n        miniBrain[prop].act()\n      }\n    }\n  }\n}\n\nfor (var prop in miniBrain) {\n  desc[prop] = miniBrain[prop].synapseFiringTrigger\n}\n\ndbind(desc)\n\n// pick a random neuron\nconst neuronId = 'n' + Math.round(Math.random() * maxNeurons)\nconst probe = {}\nprobe[neuronId] = dbind.propstore[neuronId].value++\n\ndbind(probe)\n```\n\n## Others\n\n**dbindjs** incorporates a couple of advantages over existing Javascript data binding libraries:\n* data binding only\n* merged updates\n* separation through namespaces\n* advanced fine-tuning\n* consistent protection\n* pause/resume features\n* introduces the concept of 'binding pool'\n\nFurther developments arriving soon.\n\n**dbindjs** is © Copyright 2017-2024 Nicolae Iotu, nicolae.g.iotu@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaeiotu%2Fdbindjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolaeiotu%2Fdbindjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolaeiotu%2Fdbindjs/lists"}