# API The API mirrors the CLI except you must provide a `stream` for logging, and it provides a couple extra options. ### `b = budo([entry], [opts])` Sets up a new instance of `budo`, where `entry` is a path or or array of paths. `entry` can be optional -- if no entry paths are given, budo simply acts as a static HTTP server with optional LiveReload. The return value is an event emitter. Examples: ```js var budo = require('budo') var babelify = require('babelify') budo('./src/index.js', { live: true, // live reload stream: process.stdout, // log to stdout port: 8000, // use this as the base port browserify: { transform: babelify // use ES6 } }).on('connect', function(ev) { //... }) ``` #### `opts` All settings are optional. - `port` (Number) - the base port to use for the development server (default `9966`) - `livePort` (Number) - the base port to use for the LiveReload server (default `35729`) - `portfind` (Boolean) - whether to use portfinding to find the next available ports (default `true`) - `host` (String) - the host to listen on (default `'localhost'`) - `live` (Boolean|String|Object) - whether to set up a default LiveReload integration (see [LiveReload](./live-reload.md)) - if a string is specified, only filenames matching that glob will trigger LiveReload events - object will be passed along to the [`live()`](#bliveopt) function - `cors` (Boolean) - Set the header to use CORS (`Access-Control-Allow-Origin: *`) - `ssl` (Boolean) - Creates an HTTPS server instead of HTTP - `cert` (String) - The SSL public certificate file path (default `'cert.pem'`) - `key` (String) - The SSL private key file path (default `'key.pem'`) - `watchGlob` (Array|String) - a glob string or array of glob strings to use as the default when `opts.live` is specified, or when `live()` is called without arguments - defaults to `'**/*.{html,css}'` - `open` (Boolean) - whether to launch the browser (default `false`) - `dir` (String|Array) - a folder or list of folders to use as the base path for static assets (default `process.cwd()`) - a default `index.html` will be searched in the first `dir` folder - `stream` (writable stream) - a writable stream like `process.stdout` for ndjson logging (default `undefined`) - `debug` (Boolean) - whether to enable source maps from browserify (default `true`) - `serve` (String) - if specified, the `