{"_id":"breq","_rev":"9-8bb0370826edd5e84b28063e191efe45","name":"breq","description":"A client-side CommonJS `require` implementation that does NOT require a precompilation build step nor server-side middleware. It instead utilizes synchronous `XMLHttpRequest`s and `eval` instead, which does impose a series of limitations unless you're wil","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"breq","title":"browser-require","version":"0.2.0","description":"A client-side CommonJS `require` implementation that does NOT require a precompilation build step nor server-side middleware. It instead utilizes synchronous `XMLHttpRequest`s and `eval` instead, which does impose a series of limitations unless you're wil","keywords":["browser","require","commonjs","browser-require"],"homepage":"https://github.com/JamesMGreene/breq","licenses":[{"type":"MIT","url":"https://github.com/JamesMGreene/breq/blob/master/LICENSE"}],"author":{"name":"James M. Greene","email":"james.m.greene@gmail.com","url":"http://jamesgreene.net/"},"repository":{"type":"git","url":"https://github.com/JamesMGreene/breq.git"},"bugs":{"url":"https://github.com/JamesMGreene/breq/issues"},"devDependencies":{"qunitjs":"~1.12.0","grunt":"~0.4.2","grunt-contrib-jshint":"~0.7.2","grunt-contrib-connect":"~0.5.0","grunt-contrib-qunit":"~0.3.0","grunt-contrib-clean":"~0.5.0","grunt-contrib-uglify":"~0.2.7","grunt-contrib-watch":"~0.5.3","grunt-contrib-concat":"~0.3.0"},"main":"./src/browser-require.js","scripts":{"test":"grunt travis --verbose"},"_id":"breq@0.2.0","dist":{"shasum":"b9eefa3d3323d33b257d1bf34edbe93f7b75fabf","tarball":"https://registry.npmjs.org/breq/-/breq-0.2.0.tgz","integrity":"sha512-on71uqK2796AHz/GaavYpAf1SAwIhm6hI6L6giPr1LD6ET9kf6796isZkqm7ukQR6xoD2WLsYZEYSgyg7xTMKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEF3i91HGaLTEm6b2Ccq7+NrElxw9UcvsGG63ZESuHzbAiBa/hRpvcqnvEij3Sa2xLV7WYcoLRkXVCQcGrc1gEwDdA=="}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"jamesmgreene","email":"james.m.greene@gmail.com"},"maintainers":[{"name":"jamesmgreene","email":"james.m.greene@gmail.com"}]},"0.2.1":{"name":"breq","title":"browser-require","version":"0.2.1","description":"A client-side CommonJS `require` implementation that does NOT require a precompilation build step nor server-side middleware. It instead utilizes synchronous `XMLHttpRequest`s and `eval` instead, which does impose a series of limitations unless you're wil","keywords":["browser","require","commonjs","browser-require"],"homepage":"https://github.com/JamesMGreene/breq","licenses":[{"type":"MIT","url":"https://github.com/JamesMGreene/breq/blob/master/LICENSE"}],"author":{"name":"James M. Greene","email":"james.m.greene@gmail.com","url":"http://greene.io/"},"repository":{"type":"git","url":"git+https://github.com/JamesMGreene/breq.git"},"bugs":{"url":"https://github.com/JamesMGreene/breq/issues"},"devDependencies":{"qunitjs":"~1.12.0","grunt":"~0.4.2","grunt-contrib-jshint":"~0.7.2","grunt-contrib-connect":"~0.5.0","grunt-contrib-qunit":"~0.3.0","grunt-contrib-clean":"~0.5.0","grunt-contrib-uglify":"~0.2.7","grunt-contrib-watch":"~0.5.3","grunt-contrib-concat":"~0.3.0"},"main":"./src/browser-require.js","scripts":{"test":"grunt travis --verbose"},"gitHead":"78468d93fcde4fb7629295b783be696e9676038b","_id":"breq@0.2.1","_shasum":"091fd1a6e3d6078f61dec5e6fcb5379944778221","_from":".","_npmVersion":"3.3.4","_nodeVersion":"0.10.40","_npmUser":{"name":"jamesmgreene","email":"james.m.greene@gmail.com"},"maintainers":[{"name":"jamesmgreene","email":"james.m.greene@gmail.com"}],"dist":{"shasum":"091fd1a6e3d6078f61dec5e6fcb5379944778221","tarball":"https://registry.npmjs.org/breq/-/breq-0.2.1.tgz","integrity":"sha512-8vy5NrQpH8uIH0v9cA4S8HlMkg4eG0GDgX5LRD0lpvELt9Y3XU1YhtlW7FtqjmEALU/N8BGESgrpNsJnZHm+bg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDCjUQJN4eOcWsfgMd6GhNH0l0izzXDDog/pGDNL036pAiEAsWNMbgBdVuUZoMEuday+2Rzxrr+Y0J3ssAW8bb+4Zs8="}]}}},"readme":"[![Build Status](https://travis-ci.org/JamesMGreene/breq.png?branch=master)](https://travis-ci.org/JamesMGreene/breq)\n\n# breq\n\n\"breq\" (browser-require) is a client-side CommonJS `require` implementation that does NOT require a\nprecompilation build step nor server-side middleware. It instead utilizes synchronous\n`XMLHttpRequest`s and `eval` instead, which does impose a series of [limitations](#limitations)\nunless you're willing to generate a whole mess of `404`s.\n\nTerrible for performance, nice for dynamic ease of use.\n\n\n## Getting Started\nDownload the [production version][min] or the [development version][max].\n\n[min]: https://raw.github.com/JamesMGreene/breq/master/dist/breq.min.js\n[max]: https://raw.github.com/JamesMGreene/breq/master/dist/breq.js\n\nIn your web page:\n\n```html\n<script src=\"dist/breq.min.js\"></script>\n<script>\n  var mod = require(\"./someCjsModule.js\");\n</script>\n```\n\n\n## Limitations\nGiven the browser-based nature of \"breq\", there are some important limitations to keep in mind that\ndiffer from Node's `require.resolve` lookup algorithms:\n 1. It only works over HTTP and HTTPS due to browser security settings for `XMLHttpRequest`.\n 2. It does NOT do any actual \"lookups\", it only resolves the exact relative path provided.\n 3. It currently only supports paths that start with one of the following patterns:\n      1. `/`\n      2. `./`\n      3. `../`\n 4. It does not support the \"any depth\" `node_modules` dynamic lookup for named modules as this\n    would usually result in a series of `404`s before it is located.\n 5. It does not attempt to append the \".js\" extension, etc. to the path provided. As this is made\n    for the web, URI paths are critical and some users will need to consume scripts that do not\n    end with the \".js\" extension.\n 6. It does not support loading CoffeeScript modules.\n 7. It does not currently support loading JSON \"modules\".\n\n\n## Roadmap Brainstorming\nSome ideas for future exploration in \"breq\":  \n\n 1. Add support for JSON \"modules\".\n 2. Add a configuration object.\n 3. Allow consumers to configure a \"module root\" [with either a method like `setModuleRoot` or\n    a config property like `require.paths`] where we can seek out named modules, e.g.\n     ```js\nrequire.setModuleRoot(\"/node_modules/\");\nvar mod = require(\"myCjsModule\");     // path will [first] resolve to \"/node_modules/myCjsModule/index.js\"\n```\n\n 4. Allow consumers to set a configuration option that _does_ enable the actual Node-style lookup\n    algorithm, keeping in mind that this setup will likely produce an exceptionally large quantity\n    of `404`s. This would also include auto-appending the \".js\" extension during some of the lookup\n    attempts if it is not already present, e.g.\n     ```js\nvar mod = require(\"./myCjsModule\");  // path will resolve to \"./myCjsModule.js\"\n```\n","maintainers":[{"name":"jamesmgreene","email":"james.m.greene@gmail.com"}],"time":{"modified":"2022-06-13T05:05:41.265Z","created":"2013-11-30T10:26:31.813Z","0.2.0":"2013-11-30T10:26:34.236Z","0.2.1":"2015-10-01T04:20:30.174Z"},"author":{"name":"James M. Greene","email":"james.m.greene@gmail.com","url":"http://greene.io/"},"repository":{"type":"git","url":"git+https://github.com/JamesMGreene/breq.git"},"homepage":"https://github.com/JamesMGreene/breq","keywords":["browser","require","commonjs","browser-require"],"bugs":{"url":"https://github.com/JamesMGreene/breq/issues"},"readmeFilename":"README.md","users":{"grabantot":true}}