{"id":28315797,"url":"https://github.com/drborges/yo-bro","last_synced_at":"2025-10-10T22:47:24.419Z","repository":{"id":21178962,"uuid":"24483795","full_name":"drborges/yo-bro","owner":"drborges","description":"WebGL game inspired by GunBros. This is a study case that attempts to integrate some of the cool technologies available in modern web browsers, such as WebGl, WebAudio, WebSockets, etc.","archived":false,"fork":false,"pushed_at":"2015-02-20T15:34:46.000Z","size":18860,"stargazers_count":1,"open_issues_count":23,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-01T11:15:34.010Z","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/drborges.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":"2014-09-26T02:50:00.000Z","updated_at":"2015-02-20T15:34:46.000Z","dependencies_parsed_at":"2022-08-22T18:31:18.591Z","dependency_job_id":null,"html_url":"https://github.com/drborges/yo-bro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drborges/yo-bro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drborges%2Fyo-bro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drborges%2Fyo-bro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drborges%2Fyo-bro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drborges%2Fyo-bro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drborges","download_url":"https://codeload.github.com/drborges/yo-bro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drborges%2Fyo-bro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005460,"owners_count":26083902,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-05-25T01:12:33.408Z","updated_at":"2025-10-10T22:47:24.414Z","avatar_url":"https://github.com/drborges.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"yo-bro\n======\n\nWebGL game inspired by GunBros. This is a study case that attempts to integrate some of the cool technologies available in modern web browsers, such as WebGl, WebAudio, WebSockets, etc.\n\nWoodsJS\n=======\n\nA microframework for general purpose application, with support for dependency injection, and event driven programming.\n\n## Requirements\n\n### Module Definition\n\nA module is defined using woods#module method, which uses a sintax similar to AngularJS's one\n\nExample:\n\n```javascript\nvar woods = require('woods.js')\nvar module = woods.module('my.company.module')\n```\n\n### Module Dependencies\n\nA list of resolved modules can be passed in as the module dependencies. The injectables defined within each module dependency, are then available for injection when defining a new injectable for instance.\n\nExample:\n\n```javascript\nvar woods = require('woods.js')\n  , anotherModule = require('anAwesomeModule')\n  , yetAnotherModule = require('yetAnotherAwesomeModule')\n\nvar moduleWithDependencies = woods.module('my.company.module', [ anotherModule, yetAnotherModule ])\n```\n\n### Dependency Injection\n\nDependency Injection is similar to AngularJS's one (Annotated vs. parameter name based)\n\n#### 1. Annotated dependency injection\n\nA list of dependencies names is provided as the second argument of the woods#define method, and the dependencies are passed into the callback in the same order they were listed.\n\n```javascript\nvar woods = require('woods.js')\n\nmodule.exports = woods.module('my.company.module')\n\n  .define('Curry', [ 'Multiplication' ], function (Multiplication) {\n    return function (a) {\n      return function (b) {\n        return Multiplication(a, b);\n      };\n    };\n  })\n\n  .define('Multiplication', function () {\n    return function (a, b) {\n      return a * b;\n    };\n  })\n```\n\n#### 2. Parameter based dependency injection\n\nThe dependencies are derived from the callback parameters names through parsing process. This mechanism, like AngularJS's one, is not minification safe, thus requiring a build step to annotate properly the injectable definitions (see gulp-angular-annotate plugin for insights).\n\nImplementation [example](https://github.com/nailgun/q-injector/blob/master/lib/injector.js)\n\n```javascript\nvar woods = require('woods.js')\n\nmodule.exports = woods.module('my.company.module')\n\n  .define('Curry', function (Multiplication) {\n    return function (a) {\n      return function (b) {\n        return Multiplication(a, b);\n      };\n    };\n  })\n\n  .define('Multiplication', function () {\n    return function (a, b) {\n      return a * b;\n    };\n  })\n```\n\n### Better Composition with the core service `$Decorate`\n\n```javascript\nvar woods = require('woods.js')\n\nmodule.exports = woods.module('my.company.module')\n\n  .define('Curry', function (fn) {\n    return function (a) {\n      return function (b) {\n        return fn(a, b);\n      };\n    };\n  })\n\n  .define('Multiplication', function () {\n    return function (a, b) {\n      return a * b;\n    };\n  })\n  \n  .define('DecoratedMultiplication', function ($Decorate, $Loggin, Curry, Multiplication) {\n    return $Decorate(Multiplication).using($Loggin).using(Curry)\n  })\n```\n\n### Better Reuse with the core service `$Mixin`\n\n```javascript\nvar woods = require('woods.js')\n\nmodule.exports = woods.module('my.company.module')\n\n  .define('FlyingPower', function () {\n    return {\n      fly: function () {\n        this.state = 'flying'\n      }\n    }\n  })\n\n  .define('Hero', function ($Mixin, FlyingPower) {\n    var Hero = { name: 'Superman' }\n    return $Mixin(Hero).with(FlyingPower)\n  })\n  \n  .define('Vilan', function ($Mixin, FlyingPower) {\n    var Vilan = { name: 'BadassVilan' }\n    return $Mixin(Vilan).with(FlyingPower)\n  })\n\n```\n\n### Testing an Injectable\n\n```javascript\ndescribe('Curry', function () {\n  var module = require('my.company.module')\n    , inject = module.inject\n\n  it('ensures that a Hero is able to fly', inject(function (Hero, FlyingPower) {\n    expect(Hero).to.be.a.mixinOf(FlyingPower)\n  }))\n})\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrborges%2Fyo-bro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrborges%2Fyo-bro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrborges%2Fyo-bro/lists"}