{"id":22799110,"url":"https://github.com/thomd/javascript-module-wrapper","last_synced_at":"2025-07-28T12:03:05.160Z","repository":{"id":14403613,"uuid":"17114318","full_name":"thomd/javascript-module-wrapper","owner":"thomd","description":"universal wrapper for AMD, CommonJS and oldschools-JS modules (with tests)","archived":false,"fork":false,"pushed_at":"2017-03-02T21:06:33.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T19:14:54.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-23T18:52:47.000Z","updated_at":"2017-03-02T19:54:01.000Z","dependencies_parsed_at":"2022-07-21T18:18:30.426Z","dependency_job_id":null,"html_url":"https://github.com/thomd/javascript-module-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thomd/javascript-module-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomd%2Fjavascript-module-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomd%2Fjavascript-module-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomd%2Fjavascript-module-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomd%2Fjavascript-module-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomd","download_url":"https://codeload.github.com/thomd/javascript-module-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomd%2Fjavascript-module-wrapper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267512943,"owners_count":24099628,"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-07-28T02:00:09.689Z","response_time":68,"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":"2024-12-12T07:07:55.098Z","updated_at":"2025-07-28T12:03:05.139Z","avatar_url":"https://github.com/thomd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## JavaScript Modules\n\nThis is a little research project about using javascript modules.\n\n[![Build Status](https://travis-ci.org/thomd/javascript-module-wrapper.svg?branch=master)](https://travis-ci.org/thomd/javascript-module-wrapper)\n\nA universal module wrapper is wrapping your javascript library so it can work as\n\n1. **[CommonJS](http://www.commonjs.org/) module** (Implemented by [Node.js](http://wiki.thomd.net/index.php?title=Node.js), \n   [Rhino](http://wiki.thomd.net/index.php?title=Javascript_engines#Rhino), \n   [MongoDB](http://wiki.thomd.net/index.php?title=MongoDB) or\n   [CouchDB](http://wiki.thomd.net/index.php?title=CouchDB)\n   among others)\n2. **[AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) module** (mplemented \n   by [Require.js](http://wiki.thomd.net/index.php?title=Javascript_Loader#RequireJS) \n   or [curl](https://github.com/cujojs/curl) among others)\n3. **Plain JavaScript** (attached to the `global` object)\n\n### Universal Module Wrapper\n\n    (function(global, factory){\n        if (typeof define === \"function\" \u0026\u0026 define.amd) define(factory);        // AMD\n        else if (typeof module === \"object\") module.exports = factory();        // CommonJS\n        else global.myModule = factory();                                       // global context\n    }(this, function(){\n        \"use strict\";\n        return function(...) { ... }                                            // the module\n    }));\n\n### Load module using AMD\n\n    \u003cscript src=\"//requirejs.org/docs/release/2.1.0/minified/require.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      require(['module.js'], function(){\n        myModule();\n      })\n    \u003c/script\u003e\n\n### Load module using CommonJS \n\n    var myModule = require('./module');\n    myModule();\n\n### Load module using the global context\n\n    \u003cscript src=\"module.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      myModule();\n    \u003c/script\u003e\n\n## Test\n\nTests are done with [Mocha](http://mochajs.org/) using\n[Zombie](http://zombie.labnotes.org/).\n\nRun all tests for AMD, CommonJS and Plain Javascript with\n\n    npm install\n    npm test\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomd%2Fjavascript-module-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomd%2Fjavascript-module-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomd%2Fjavascript-module-wrapper/lists"}