{"_id":"@divertise-asia/moduleserve","_rev":"1-f6955c570772c13effd5197cf6c978fb","name":"@divertise-asia/moduleserve","dist-tags":{"latest":"0.9.2-alpha.1"},"versions":{"0.9.2-alpha.1":{"name":"@divertise-asia/moduleserve","version":"0.9.2-alpha.1","description":"Serve and transpile CommonJS modules over HTTP","main":"index.js","bin":{"moduleserve":"bin/moduleserve.js"},"repository":{"type":"git","url":"git+https://github.com/marijnh/moduleserve.git"},"keywords":["commonjs","module","http","development"],"author":{"name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"license":"MIT","dependencies":{"send":"^0.17.1","serve-static":"^1.14.1"},"gitHead":"b06c1db13b8ecd672e3ea82b18c49e56de218524","bugs":{"url":"https://github.com/marijnh/moduleserve/issues"},"homepage":"https://github.com/marijnh/moduleserve#readme","_id":"@divertise-asia/moduleserve@0.9.2-alpha.1","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-1Q7jWW3qqEzsvrBLXkTgF3lxoKxhKXSMX8Oa+Vyb50NxSmrzpPmG1MWSJimk8NGqSq7d5l2S3FUuTSStMnWtfw==","shasum":"4723cc902a9df9e670bfc805f779f0fb8d82fcba","tarball":"https://registry.npmjs.org/@divertise-asia/moduleserve/-/moduleserve-0.9.2-alpha.1.tgz","fileCount":8,"unpackedSize":14788,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewe4VCRA9TVsSAnZWagAA9ggQAJzW5pZLrhq6uovsN3xQ\nKvuYiZIixIl2Urido+Q+w32PEUP/2vf1IMeABBGQyzePUYSpWPz24rI4D+6j\natv+XZhvzpiBn/PUfVmOXo05VedMkcfV/20bXc7udM3Qd5Ig4pJB85p5WPgU\nkBkwJAjPhaEtkTDgXPpeMt1Dm+MadzjSqN0+COAlKvQO/Yj+gHD3tVhchz+K\naRamw0JoNJeOq6TJZx27tmKYm4NTPfszVCwF7YFo5UnnrKDNAU2WLEUiVtwL\nBRH3szxQOKrD8kr2IsVxLVgrVlYbQAWfLPbPd+OB3wG37p6SDgYyk5HkpQ7M\nRmJM6WZp83ukVPpe/w1TIFxEdOQldeZzKMmvX04vqiuWultnyHdDG9q5OVDn\nQRH/k6zzzKKt3fdl/wtHQ+HRrGvjFW2e5k55UennIQO8pHorfh/UuxOPf/6H\nnaYhW1oeKqbQ6nkZu+xVBYt8qGGkQgH/jGZG0oyQSi7+oicaOZuGrktr0Z/C\neIgAdhgBm80QWFCrcVW5NscDXdho6sBeFA47h2zTuvZjjtiKV74nFBDdyOg3\nqnbY8ufSk980iWNJ+EK5jmw0X1FdgWMao4fFzIK5Ru4QoJgvDny+WM2GBOrV\nEH/FvMWdZrc5Qd/Gmoppy0Zp30Jnl0kvP3/DSLMsrxN+D9oL9zL3sJAYO6ew\nkJ7e\r\n=kppU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIByctCrE4azfjDAwX/jz/KXIAXHwYY5ZBWSWeAS+fQueAiEAoClfCr3EW+LTegbvXDkSr2KQlm4i7O8IwdIcIAeHZVk="}]},"maintainers":[{"name":"divertiseadmin","email":"dev@divertise.asia"},{"name":"song_divertise","email":"npm@divertise.asia"}],"_npmUser":{"name":"divertiseadmin","email":"dev@divertise.asia"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/moduleserve_0.9.2-alpha.1_1589767700746_0.10509677881569113"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-18T02:08:20.445Z","0.9.2-alpha.1":"2020-05-18T02:08:20.873Z","modified":"2022-04-05T04:47:58.496Z"},"maintainers":[{"name":"divertiseadmin","email":"dev@divertise.asia"},{"name":"song_divertise","email":"npm@divertise.asia"}],"description":"Serve and transpile CommonJS modules over HTTP","homepage":"https://github.com/marijnh/moduleserve#readme","keywords":["commonjs","module","http","development"],"repository":{"type":"git","url":"git+https://github.com/marijnh/moduleserve.git"},"author":{"name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"bugs":{"url":"https://github.com/marijnh/moduleserve/issues"},"license":"MIT","readme":"# Moduleserve\n\nThis is a shim HTTP server for directly running your CommonJS (or ES6)\nmodules for development and testing (without a bundling step, and with\nthe compilation/transformation integrated in the server shim).\n\n**Warnings:**\n\n * The server basically exposes your whole filesystem over HTTP. It\n   binds to `\"localhost\"` by default, but if you bind it to something\n   else or proxy in some uncautious way, you are putting yourself at\n   risk.\n\n * This does everything syncronously, both on client and server.\n\n * This is a hack that I am using for my own development, not\n   generally-useful, supported software. You might be able to make use\n   of it, but if you run into a problem, you should try to debug it\n   yourself, not ask me for help.\n\n * The code is likely to break if you do something that I'm not doing.\n   Pull requests welcome!\n\n## What it does\n\nYou run the server for a given directory...\n\n    moduleserve demo/ --port 8080\n\nIt will start up an HTTP server on the given port, serving the content\nof the `demo` directory statically. In addition, it exposes a URL\n`/moduleserve/load.js`, which you use to load your main module:\n\n    <script src=\"/moduleserve/load.js\" data-module=\"./mymodule\"></script>\n\nThat will pull in the client-side scaffolding and look for\n`./mymodule`, resolved relative to the directory that the server is\nrunning on. You can add a `data-require` attribute to the tag to have\nit set a global `require` variable, which you can use to load modules\nfrom the console.\n\nThat module is loaded as a\n[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1) module, and may\nuse `require` with the regular node.js conventions (implicit `.js` or\n`/index.js`, searching `node_modules`, etc). The intention is that,\ncontrary to systems like JSPM, you don't have to set up your project\nto please this tool, but you can just directly use it on an npm-style\ncodebase.\n\nYou can pass `moduleserve` a `--transform` option, which should point\nat a node module that defines a transformer. Such a transformer is\ncalled on a file before it is served. It should export a `transform`\nfunction that takes `(filename, text)` parameter and returns the\ntransformed text. If it also exports an `init` function, that is\ncalled once with the target directory of the server.\n\nIf you pass `--transform babel`, you get a built-in transformer that\nloads `babel` in the context of the target directory (i.e. you have to\nhave it installed locally there, or globally) that you're running the\ntool on, and uses it to transform any files whose path does not\ncontain `node_modules/`.\n\nIf you pass `--spa`, every file path where no file can be found automatically will fall back to serving the `index.html`. This option allows you to implement routing for Single Page Applications.\n\nThe client is going to make a request for every single module file, so\nfor a bigger project the initial load is bound to be slow, especially\nif you're using an expensive transform. The server then caches these\nand sends 302 responses whenever possible, so assuming localhost-level\nlatency, subsequent loads should be faster.\n\n## Source\n\nThis code is open-source under an MIT license. If you want to\ncontribute, create pull requests\n[on GitHub](https://github.com/marijnh/moduleserve/).\n","readmeFilename":"README.md"}