{"id":13464973,"url":"https://github.com/mattdesl/budo","last_synced_at":"2025-05-14T07:08:28.931Z","repository":{"id":27333935,"uuid":"30808587","full_name":"mattdesl/budo","owner":"mattdesl","description":":clapper: a dev server for rapid prototyping","archived":false,"fork":false,"pushed_at":"2022-08-30T10:40:36.000Z","size":2445,"stargazers_count":2174,"open_issues_count":41,"forks_count":105,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-05-12T16:15:32.523Z","etag":null,"topics":[],"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/mattdesl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-02-14T20:56:45.000Z","updated_at":"2025-04-29T16:32:53.000Z","dependencies_parsed_at":"2022-08-17T18:20:26.387Z","dependency_job_id":null,"html_url":"https://github.com/mattdesl/budo","commit_stats":null,"previous_names":["mattdesl/mystc"],"tags_count":129,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdesl%2Fbudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdesl%2Fbudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdesl%2Fbudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdesl%2Fbudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattdesl","download_url":"https://codeload.github.com/mattdesl/budo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092776,"owners_count":22013290,"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-07-31T14:00:53.755Z","updated_at":"2025-05-14T07:08:28.910Z","avatar_url":"https://github.com/mattdesl.png","language":"JavaScript","readme":"# budō\n\n[![build status][travis-image]][travis-url]\n[![stability][stability-image]][stability-url]\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][downloads-url]\n[![js-standard-style][standard-image]][standard-url]\n\nThis is a [browserify](https://github.com/substack/node-browserify) development server focused on incremental reloading, LiveReload integration (including CSS injection) and other high-level features for rapid prototyping.\n\nTo install it globally:\n\n```sh\nnpm install budo -g\n```\n\nRunning budo will start a server with a default `index.html` and incrementally bundle your source on filesave. The requests are delayed until the bundle has finished, so you won't be served stale or empty bundles if you refresh the page mid-update. Examples:\n\n```sh\n# serve file on port 9966 and open browser\nbudo index.js --open\n\n# enable LiveReload on HTML/CSS/JS file changes\nbudo index.js --live\n\n# default html will use src=\"static/bundle.js\"\nbudo src/index.js:static/bundle.js\n\n# pass some options to browserify\nbudo index.js --live -- -t babelify\n\n# use HTTPS and enable CORS headers\nbudo index.js --ssl --cors\n\n# LiveReload public directory without any bundling\n# Add all extensions of file types you want to trigger reloads\nbudo --dir public/ --wg **/*.{html,css,js} --live\n```\n\nThen open [http://localhost:9966/](http://localhost:9966/) to see the content in action.\n\nBy default, budo pretty-prints to terminal with [garnish](https://github.com/mattdesl/garnish).\n\n\u003ccenter\u003e\u003cimg src=\"https://raw.githubusercontent.com/mattdesl/budo/master/screenshots/terminal.png\" width=\"75%\" /\u003e\u003c/center\u003e\n\nSee [docs](#docs) for more details and integrations, such as [React Hot Module Replacement](./docs/command-line-usage.md#hot-module-replacement), [Pushstate Servers](./docs/command-line-usage.md#pushstate) and [HTTPS](./docs/command-line-usage.md#ssl-and-https). PRs/suggestions/comments welcome.\n\n## features\n\nAt a glance:\n\n- serves a default `index.html`\n- fast incremental bundling, suspending the response until the new source is ready\n- watches HTML and CSS files for changes; CSS is injected without reloading the page\n- can emit [ndjson](http://ndjson.org) logs to use another pretty-printer, like [bistre](https://github.com/hughsk/bistre).\n- provides clear error messaging during development in DOM and console\n- supports SSL and can generate a self-signed certificate\n- the rich API allows you to build more complex development tools on top of budo\n\nBelow is an example of how syntax errors look during development, using the [babelify](https://github.com/babel/babelify) transform.\n\n\u003ccenter\u003e\u003cimg src=\"https://raw.githubusercontent.com/mattdesl/budo/master/screenshots/build-error.png\" width=\"75%\" /\u003e\u003c/center\u003e\n\n## docs\n\n- [command line usage](./docs/command-line-usage.md)\n- [API usage](./docs/api-usage.md)\n- [running tests and examples](./docs/tests-and-examples.md)\n- [rapid prototyping with budō](http://mattdesl.svbtle.com/rapid-prototyping)\n- [experimental script injection with budo-chrome](https://github.com/mattdesl/budo-chrome)\n\n## usage\n\n[![NPM](https://nodei.co/npm/budo.png)](https://www.npmjs.com/package/budo)\n\n### CLI\n\nDetails for `budo` command-line interface.\n\n```txt\nUsage:\n  budo index.js [opts] -- [browserify opts]\n\nOptions:\n  --help, -h       show help message\n  --version        show version\n  --port, -p       the port to run, default 9966\n  --host, -H       the host, default internal IP (localhost)\n  --dir, -d        a path, or array of paths for base static content\n  --serve, -s      override the bundle path being served\n  --live, -l       enable default LiveReload integration\n  --live-port, -L  the LiveReload port, default 35729\n  --open, -o       launch the browser once connected\n  --pushstate, -P  always render the index page instead of a 404 page\n  --base           set the base path for the generated HTML, default to '/'\n  --onupdate       a shell command to trigger on bundle update\n  --poll=N         use polling for file watch, with optional interval N\n  --title          optional title for default index.html\n  --css            optional stylesheet href for default index.html\n  --ssl, -S        create an HTTPS server instead of HTTP\n  --cert, -C       the cert for SSL (default cert.pem)\n  --key, -K        the key for SSL (default key.pem)\n  --cors           set header to use CORS (Access-Control-Allow-Origin: *)\n  --ndjson         print ndjson instead of pretty-printed logs\n  --verbose, -v    also include debug messages\n  --force-default-index always serve a generated index.html instead of a static one\n  --no-stream      do not print messages to stdout\n  --no-debug       do not use inline source maps\n  --no-portfind    will not attempt auto-portfinding\n  --no-error-handler    disable default DOM error handling\n  --watch-glob, --wg    glob(s) to watch for reloads, default '**/*.{html,css}'\n  --static-options      subarg options to pass to serve-static module\n```\n\nBy default, messages will be printed to `process.stdout`, and `--debug` will be sent to browserify (for source maps). You can turn these off with `--no-stream` and `--no-debug`, respectively.\n\nEverything after `--` is passed directly to browserify. Example:\n\n```js\nbudo index.js --live -- -t [ babelify --extensions .es6 ]\n```\n\n### API\n\nThe API mirrors the CLI except it does not write to `process.stdout` by default.\n\n```js\nvar budo = require('budo')\nvar babelify = require('babelify')\n\nbudo('./src/index.js', {\n  live: true,             // setup live reload\n  port: 8000,             // use this port\n  browserify: {\n    transform: babelify   // ES6\n  }\n}).on('connect', function (ev) {\n  console.log('Server running on %s', ev.uri)\n  console.log('LiveReload running on port %s', ev.livePort)\n}).on('update', function (buffer) {\n  console.log('bundle - %d bytes', buffer.length)\n})\n```\n\nSee [API usage](docs/api-usage.md) for details.\n\n## See Also\n\nbudō combines several smaller and less opinionated modules.\n\n- [watchify-middleware](https://www.npmjs.com/package/watchify-middleware) - the underlying request handler for serving incremental reloads\n- [watchify-server](https://www.npmjs.com/package/watchify-server) - a less opinionated alternative to budo, built on the same underlying modules\n- [simple-html-index](https://www.npmjs.com/package/simple-html-index) - a stream for a default `index.html` file\n\nAlso, special thanks to [beefy](https://github.com/chrisdickinson/beefy) and [wzrd](https://github.com/maxogden/wzrd) which originally inspired budo.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/budo/blob/master/LICENSE.md) for details.\n\n[stability-image]: https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square\n[stability-url]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[npm-image]: https://img.shields.io/npm/v/budo.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/budo\n[travis-image]: https://img.shields.io/travis/mattdesl/budo/master.svg?style=flat-square\n[travis-url]: http://travis-ci.org/mattdesl/budo\n[downloads-image]: http://img.shields.io/npm/dm/budo.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/budo\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: https://github.com/feross/standard\n","funding_links":[],"categories":["JavaScript","工程","others","Tools"],"sub_categories":["redux 扩展","macros","Development Servers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdesl%2Fbudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattdesl%2Fbudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdesl%2Fbudo/lists"}