{"id":13517486,"url":"https://github.com/bokub/lyo","last_synced_at":"2025-10-02T23:35:38.168Z","repository":{"id":66332404,"uuid":"146791738","full_name":"bokub/lyo","owner":"bokub","description":"📦 Node.js to browser - The easy way","archived":true,"fork":false,"pushed_at":"2018-10-15T06:27:33.000Z","size":242,"stargazers_count":621,"open_issues_count":0,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-13T03:35:58.261Z","etag":null,"topics":["babel","browser","browserify","build","compiler","es5","minify","module","uglify"],"latest_commit_sha":null,"homepage":"","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/bokub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-08-30T18:40:52.000Z","updated_at":"2024-06-04T22:01:14.000Z","dependencies_parsed_at":"2023-02-20T21:15:51.149Z","dependency_job_id":null,"html_url":"https://github.com/bokub/lyo","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Flyo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Flyo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Flyo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bokub%2Flyo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bokub","download_url":"https://codeload.github.com/bokub/lyo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235051559,"owners_count":18928185,"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":["babel","browser","browserify","build","compiler","es5","minify","module","uglify"],"created_at":"2024-08-01T05:01:34.285Z","updated_at":"2025-10-02T23:35:37.814Z","avatar_url":"https://github.com/bokub.png","language":"JavaScript","readme":"![Lyo](https://user-images.githubusercontent.com/17952318/44954822-2055cc80-aea9-11e8-9ebd-b10619f80171.png)\n\n\u003e Node.js to browser - The easy way\n\n[![Npm version](https://runkit.io/bokub/npm-version/branches/master/lyo)](https://npmjs.com/package/lyo)\n[![Build status](https://badgen.net/travis/bokub/lyo)](https://travis-ci.org/bokub/lyo)\n[![Code coverage](https://badgen.net/codecov/c/github/bokub/lyo)](https://codecov.io/gh/bokub/lyo)\n[![XO code style](https://badgen.net/badge/code%20style/XO/5ed9c7)](https://github.com/xojs/xo)\n\nLyo is the easiest way to transform Node.js modules into browser-compatible libraries.\n\nNo decision-making, no configuration needed, it just works!\n\nLyo uses [Browserify][browserify], [Babel][babel], [UglifyJS][uglify], and a pinch of magic ✨ so you don't have to\nworry about configuration\n\n## Install \u0026 Run\n\n```sh\n# Install globally\nnpm i -g lyo\n\n# Run (on your own module)\nlyo\n\n# Run (on any npm module)\nlyo get \u003cmodule\u003e\n```\n\nLyo will create a single `.min.js` file that you can import in a `\u003cscript\u003e` tag\n\n```html\n\u003cscript src=\"my-module.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  myModule('foo');\n\u003c/script\u003e\n```\n\n## Options\n\nLyo is supposed to work right away, but you can force things with some options if needed.\n\n```\n$ lyo --help\n\n    Usage\n      $ lyo [options]               Run Lyo\n      $ lyo init [options]          Add Lyo to your project\n      $ lyo usage [options]         Show how to use the output file\n      $ lyo get \u003cmodule\u003e [options]  Run Lyo on a module from npm\n\n    Options\n      --input   -i  Entry file\n      --output  -o  Output file / folder\n      --name    -n  Module name in browser\n      --banner  -b  Add a banner to the top of the bundle\n\n    Examples\n      $ lyo\n      $ lyo -i main.js\n      $ lyo -n runFunction\n      $ lyo get query-string\n      $ lyo -o dist/bundle.min.js\n      $ lyo -b 'Lyo\\nLicensed under MIT'\n```\n\n\n## Tips\n\n- Add a `.babelrc` file at the root of your project to [configure][babel-config] the Babel compilation step\n- The bundle is supposed to run in browsers. A bundle used in a Node.js program will probably be slower than the original module\n- Don't blame Lyo if it fails to compile your code. The error could come from [Browserify][browserify], [Babel][babel] or [UglifyJS][uglify]\n- If you like Lyo, you will love [lyo.now.sh](https://lyo.now.sh/), an automated bot 🤖 running Lyo on npm modules of your choice\n\n\n## Using Lyo on your own module\n\nOnce you've tried Lyo on your module and figured the best options to use, you should consider the following steps\n\n### 1. Add Lyo to your project\n\nRun `lyo init` (with options) to edit your `package.json` as follows:\n\n- Lyo will be added to the dev dependencies\n- A pre-publish script will be created (or edited) so Lyo is triggered before every `npm publish`\n- If you provide options, **they will be saved as default options**\n\n```sh\n# Example with some random options\n$ lyo init -i lib/main.js -n runMyModule\n```\n![package.json](https://i.imgur.com/yxBGqne.png)\n\nDon't forget to run `npm install` after that\n\n### 2. Add documentation\n\nRun `lyo usage` (with options) to show an example code snippet. You can edit and include it in your `README.md`.\n\n```\n$ lyo usage\n\n\u003e Edit and include the following snippet in your README.md\n```\n![HTML example](https://i.imgur.com/xryNOT5.png)\n\n\n### 3. Commit and publish\n\nLyo will output a single file called a _bundle_, by default in a `dist` folder. You can choose to commit it, or not.\nIt's really up to you.\n\nRun `npm publish`, Lyo will compile your module, and the bundle will be pushed to the npm registry with the rest of your module.\nCongratulations, you're done! 💪\n\n\n## Using Lyo on someone else's module\n\nSometimes, you stumble upon a npm module without a browser-compatible version.\n\nNo worries, just run `lyo get \u003cmodule\u003e` to download and compile it right away ⚡\n\n```sh\n# Compile query-string (npmjs.com/package/query-string)\n$ lyo get query-string\n\n# Compile a specific version of Joi (npmjs.com/package/joi)\n$ lyo get joi@13.5.0 --name Joi\n```\n\n_____\n\n## FAQ\n\n#### What if I need unsupported features?\n\nIf you need features unsupported by Lyo (sourcemaps, code splitting...), your best option is not using Lyo, which is\nnothing more than an all-in-one package, with automatic configuration.\n\nHowever, if you think Lyo should support this feature, feel free to create a new\n[issue](https://github.com/bokub/lyo/issues)!\n\n#### Why Lyo when there are thousands of better tools doing the same thing?\n\nLyo's philosophy is highly inspired from [XO](https://github.com/xojs/xo), a linter that works immediately, without any\nconfiguration. XO is just an ESLint wrapper, but it saves you the hassle of choosing ESLint rules, adding them to a\nnew `.eslintrc` file, installing plugins...\n\nI use XO for almost all my projects, but I could not find any tool as simple as XO for Node.js \u003e browser compilation.\nThat's why I created Lyo\n \n#### What does Lyo mean?\n\nLyo is short for [lyophilization](https://en.wiktionary.org/wiki/lyophilization), a process that transforms food\ninto a dry and compact form\n\n\n## License\n\nMIT © [Boris K](https://github.com/bokub)\n\n[browserify]: https://github.com/browserify/browserify\n[babel]: https://github.com/babel/babel\n[babel-config]: https://babeljs.io/docs/en/configuration\n[uglify]: https://github.com/mishoo/UglifyJS2\n","funding_links":[],"categories":["JavaScript","*.js"],"sub_categories":["Node"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbokub%2Flyo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbokub%2Flyo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbokub%2Flyo/lists"}