{"id":18657942,"url":"https://github.com/lightsofapollo/cross-env-js-modules","last_synced_at":"2025-11-05T22:30:24.278Z","repository":{"id":140858252,"uuid":"4474423","full_name":"lightsofapollo/cross-env-js-modules","owner":"lightsofapollo","description":"paradigm for creating cross environment (node/browser) modules without external libraries. ","archived":false,"fork":false,"pushed_at":"2012-05-28T20:50:49.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-27T15:12:51.716Z","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/lightsofapollo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-28T20:36:32.000Z","updated_at":"2013-12-14T18:11:46.000Z","dependencies_parsed_at":"2023-03-12T00:45:18.070Z","dependency_job_id":null,"html_url":"https://github.com/lightsofapollo/cross-env-js-modules","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/lightsofapollo%2Fcross-env-js-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fcross-env-js-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fcross-env-js-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsofapollo%2Fcross-env-js-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightsofapollo","download_url":"https://codeload.github.com/lightsofapollo/cross-env-js-modules/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475960,"owners_count":19645041,"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-07T07:30:42.304Z","updated_at":"2025-11-05T22:30:24.240Z","avatar_url":"https://github.com/lightsofapollo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cross Environment Modules\n\nWhile developing libraries that where intended to run on both node and the browser I wanted\nto create a simple method of defining modules (think node not AMD) that would behave \nthe same in both the browser and node.\n\n## Goals:\n\n  1. In the browser provide familiar semantics where\n     there is aways _one_ top level namespace and sub components\n     can live inside this namespace.\n     \n     ````js\n     var instance = new Module.Thing();\n     ````\n\n  2. Even though libraries may be intended to be bundled into a single\n     javascript file for simple inclusion in the browser (think mocha.js) \n     each component also  be able to run standalone or with only its\n     immediate dependancies included.\n     \n     The intend is that if you develop some awesome library with utility X\n     some other author can include utility X without your entire library\n     and without figuring out your build system. Simply include utility X\n     and any of its dependancies and it should work.\n     \n     \n  3. Node conventions are followed when running in node noone should\n     know or care that you are taking special steps to also run in the browser.\n     \n     ````js\n     var Module = require('module');\n     var instance = new Module.Thing();\n     \n     //also!\n     \n     //this will also work if thing has dependancies\n     //on other files inside your library.\n     var instance = require('module/lib/thing');\n     \n     ````\n     \n  4. Achieve 1-3 without dependancies on an external library with\n     an absolutely minimal footprint and no special build process.\n\n## Test it out\n\nLoad index.html in your browser \n\nRun `bin/test-node-individual` and `bin/test-node-all`\n\n## LICENSE\n\n(MIT) see LICENSE.md","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fcross-env-js-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightsofapollo%2Fcross-env-js-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsofapollo%2Fcross-env-js-modules/lists"}