{"id":20250339,"url":"https://github.com/cmtegner/youemdee","last_synced_at":"2025-06-21T03:40:40.934Z","repository":{"id":57404175,"uuid":"81736428","full_name":"CMTegner/youemdee","owner":"CMTegner","description":"Wrap a browserify/browser-pack JavaScript bundle in a Universal Module Definition (UMD) with optional external dependencies, while preserving source maps","archived":false,"fork":false,"pushed_at":"2017-02-13T16:34:21.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T00:38:23.883Z","etag":null,"topics":["browserify","build-tool","bundler","umd-modules"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CMTegner.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}},"created_at":"2017-02-12T15:37:37.000Z","updated_at":"2023-03-08T04:54:53.000Z","dependencies_parsed_at":"2022-09-12T12:40:19.793Z","dependency_job_id":null,"html_url":"https://github.com/CMTegner/youemdee","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/CMTegner%2Fyouemdee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMTegner%2Fyouemdee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMTegner%2Fyouemdee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMTegner%2Fyouemdee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CMTegner","download_url":"https://codeload.github.com/CMTegner/youemdee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241696878,"owners_count":20004903,"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":["browserify","build-tool","bundler","umd-modules"],"created_at":"2024-11-14T09:57:58.922Z","updated_at":"2025-03-03T16:23:27.313Z","avatar_url":"https://github.com/CMTegner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# youemdee [![Build Status](https://travis-ci.org/CMTegner/youemdee.svg?branch=master)](https://travis-ci.org/CMTegner/youemdee)\n\nWrap a browserify/browser-pack JavaScript bundle in a Universal Module Definition (UMD) with optional external dependencies, while preserving source maps.\n\n## Example\n\nPlug this into your build chain just as you would with any other transform-stream:\n\n```bash\nbrowserify src/main.js | youemdee MyModule --dependency dep1\n```\n\nOr if you're using the Node API:\n\n```js\nbrowserify('./src/main.js')\n  .bundle()\n  .pipe(youemdee.createTransform('MyModule', dependencies))\n  .pipe(process.stdout)\n```\n\n## Usage\n\n```\nyouemdee\n\n  Reads a browserify/browser-pack JavaScript bundle from stdin and wraps it in a Universal Module Definition (UMD) with optional external dependencies. An optional source map can be provided inline in the input, and will be updated and output inline with the UMD bundle on stdout.\n\nSynopsis\n\n  $ youemdee \u003cmodule-name\u003e\n\n  It is highly encouraged to stick to [a-zA-Z] for module-name, as anything else will make accessing your module in the global scope more difficult (window.MyModule vs. window['my-module']).\n\nOptions\n\n  -h, --help         Display this usage guide\n  -d, --dependency   A dependency in the form of name[:global[:amd]], multiple occurrences allowed\n\nExamples\n\n  No external dependencies               $ youemdee MyModule \u003c bundle.js\n  React and ReactDOM as external deps.   $ youemdee MyComponent --dependency react:React --dependency react-dom:ReactDOM \u003c bundle.js\n```\n\n## API\n\n```\nconst youemdee = require('youemdee')\n```\n\n#### `youemdee(source:String, moduleName:String, dependencies:Array): String`\n\nWill wrap `source` in a UMD. If there is an inline source map found in `source` it will be extracted, updated to reflect the changes made, then reattached inline to the returned string.\n\n`moduleName` is the namespace which the module will have when attached to the global scope, e.g. `window.MyModule`. It is highly encouraged to stick to [a-zA-Z] so as not to make accessing your module unnecessarily difficult.\n\nThe optional `dependencies` is an array. Each entry can either be a string or a dependency spec of the following form:\n\n```js\n{\n  name: String, // The internal and external CJS name\n  amd: String, // Dep. name as defined in the AMD loader\n  global: String, // Dep. name in the global scope\n}\n```\n\nWhen specified as a string the value will be used for internal, external, amd, and global dependency names.\n\n#### `youemdee.createTransform(moduleName:String, dependencies:Array): Transform`\n\nJust like `youemdee()`, but instead of expecting source as an argument it returns a transform stream which reads until end, wraps in a UMD, and emits the updated bundle. Very useful in a stream-style build pipeline.\n\n## Why?\n\nbrowserify's `--standalone` works well as long as you don't have any external dependencies. [umd](https://www.npmjs.com/package/umd) itself (which browserify uses indirectly via browser-pack) doesn't yet support external dependencies.\n\n## Future\nThis tool targets browserify (or more specifically: browser-pack) bundles. It will, in theory, also work for other JavaScript bundlers that create a similar pseudo-`require` output. PRs to add support for other types of input are more than welcome.\n\n## Compatibility\nNode \u003e=6. This is only due to the level of syntactic sugar used. Writing the code down to support older versions of node won't be too much work, if the demand is there to support it.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmtegner%2Fyouemdee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmtegner%2Fyouemdee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmtegner%2Fyouemdee/lists"}