{"id":19055773,"url":"https://github.com/taskrabbit/sudojs","last_synced_at":"2025-04-24T04:29:12.736Z","repository":{"id":6808241,"uuid":"8056132","full_name":"taskrabbit/sudojs","owner":"taskrabbit","description":null,"archived":false,"fork":false,"pushed_at":"2014-01-15T15:26:07.000Z","size":2689,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-04-18T12:19:15.257Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taskrabbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-06T17:26:21.000Z","updated_at":"2014-09-13T13:19:03.000Z","dependencies_parsed_at":"2022-09-12T23:02:31.749Z","dependency_job_id":null,"html_url":"https://github.com/taskrabbit/sudojs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskrabbit%2Fsudojs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskrabbit%2Fsudojs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskrabbit%2Fsudojs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taskrabbit%2Fsudojs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taskrabbit","download_url":"https://codeload.github.com/taskrabbit/sudojs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250563842,"owners_count":21450901,"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":[],"created_at":"2024-11-08T23:46:59.451Z","updated_at":"2025-04-24T04:29:12.706Z","avatar_url":"https://github.com/taskrabbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sudo.js\n\n## Overview\n\nHigh-level, \"Model/View\" (or \"Presentation Model\") style object oriented library made to aide you in your quest for Javascript\nawesomeness by assisting with such things as implementing inheritance patterns, handling data-mutation observation,\nestablishing hierarchies of objects which have intrinsic knowledge of their responsibilies, and the making of sandwiches.\n\n## Documentaion\n\n- Specific `module` documentation and examples moved to [the wiki](https://github.com/taskrabbit/sudojs/wiki).\n- See the Docco annotated source code located in the docs directory.\n- Utilize the patterns and best practices docs in the [TechRabbit Blog](http://tech.taskrabbit.com/)\n\n## API Reference\n\n### Methods Exposed by Module and Their Corresponding Wiki Page\n\n#### [Base](https://github.com/taskrabbit/sudojs/wiki/base)\n\n+ addDelegate(object)\n+ getDelegate(role)\n+ removeDelegate(role)\n+ delegate(role, method)\n+ construct([el][, data])\n+ base(methodName[, args...])\n\n####[Model](https://github.com/taskrabbit/sudojs/wiki/model)\n\n+ set(key, value)\n+ setPath(path, value)\n+ sets(object)\n+ get(key)\n+ getPath(path)\n+ gets(array)\n+ unset(key)\n+ unsetPath(path)\n+ unsets(array)\n\n#### [Container](https://github.com/taskrabbit/sudojs/wiki/container)\n\n+ addChild(child, name)\n+ getChild(_argument_)\n+ removeChild(_argument_)\n+ bubble()\n+ removeFromParent()\n+ send(_arguments_)\n\n#### [View](https://github.com/taskrabbit/sudojs/wiki/view)\n\n+ becomePremier\n+ init\n+ resignPremier\n+ setEl(_argument_)\n+ $(selector)\n\n\n#### [observable extension](https://github.com/taskrabbit/sudojs/wiki/observable-extension)\n\n+ observe(fn)\n+ observes(array)\n+ unobserve(fn)\n+ unobserves(ary)\n+ deliverChangeReords\n\n### Modules Residing in 'Extras'\n\n####[Change Delegate](https://github.com/taskrabbit/sudojs/wiki/change-delegate)\n\n+ filter\n\n####[Data Delegate](https://github.com/taskrabbit/sudojs/wiki/data-delegate)\n\n+ filter\n\n#### [listener extension](https://github.com/taskrabbit/sudojs/wiki/listener-extension)\n\n+ bindEvents\n+ unbindEvents\n\n#### [persistable extension](https://github.com/taskrabbit/sudojs/wiki/persistable-extension)\n\n+ create([options])\n+ read([options])\n+ update([options])\n+ destroy([options])\n+ save([options])\n\n#### [DataView](https://github.com/taskrabbit/sudojs/wiki/dataview)\n\n+ addedToParent(parent)\n+ render([change])\n\n#### [template](https://github.com/taskrabbit/sudojs/wiki/template)\n\n+ template(string, data, scope)\n\n#### [ViewController](https://github.com/taskrabbit/sudojs/wiki/viewcontroller)\n\n+ instantiateChildren()\n\n#### [bindable extension](https://github.com/taskrabbit/sudojs/wiki/bindable-extension)\n\n+ setBinding()\n+ setBindings()\n\n## Test Suite\n\nThe `specRunner.html` file in `root` runs each individual module's specs. Load it as a file in your browser of\nchoice or, if you have Node.js installed you can `npm install node-static` then `node staticServer.js` which will\nserve the spec runner at `localhost:5678/specRunner.html`. This is useful, for me at least, for x-platform\ntesting as I can just point virtual machines at the host. Note that individual spec files can be run from here as well, just\nadjust the path accordingly. The `sudo.Base` module for example could be run at `localhost:5678/base/specRunner.html`\n\n## Rails Gem\n\nA rather opinionated gem is available [here](https://github.com/robrobbins/sudojs-rails). More than just making sudo builds\n(sudo and sudo-x) available for your rails apps it enforces a rather unique workflow. More info there...\n\n## Node.js Module\n\nA simplified version of `sudo.js` is available for Node:\n    \n    npm install sudoclass\n\nIt provides `sudo.js` style inheritance, key-value coding (the `sudo.js Base Object`), delegation, and data-mutation-observation via\nthe `Observable` extension. The `sudo.js` build tool is built with this.\n\n## Build Tool\n\nThe latest concatonated (but unminified) version of `sudo.js` (and `sudo-x.js` [sudo.js with added stuff]) is always\nlocated in `build/debug`. If you are making changes, adding new modules, or creating a custom build and need the `debug/`\nfiles to be rebuilt `cd` into the `build/lib` directory and run:\n\n    node run sudo.html [sudo-basic.html] [foo.html] ...\n\nNote that the `foo.html` above would represent an HTML configuration file you created for a custom build of sudo.js.\n\nYou will need `Node.js` installed as well as the `sudoclass` module mentioned above. The arguments that follow the invocation of\n`run` are the html files that the build tool uses to load the 'modules'. If you are adding new 'modules'\nbe sure to add them to sudo.html (and/or other foo.html) config file(s) or they will not be added to the concatonated `debug/` file(s).\n\n### Extras\n\nThe debug version, `build/debug/sudo.js`, contains the basic 'modules' as well as the others located in the `extras` directory that have been\ntested and documented. A basic build is also available (`sudo-basic`), this serves as an example of how to configure a custom build of\n`sudo.js` if desired.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskrabbit%2Fsudojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaskrabbit%2Fsudojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaskrabbit%2Fsudojs/lists"}