packages/perspective-cli/src/js/index.js
async function host(filename, options) {
    let files = [path.join(__dirname, "html")];
    if (options.assets) {
        files = [options.assets, ...files];
    }
    const server = new WebSocketHost({assets: files, port: options.port});
    let file;
    if (filename) {
        file = fs.readFileSync(filename).toString();
    } else {
        file = await read_stdin();
    }
    server.host_table("data_source_one", table(file));
    if (options.open) {
        open_browser(options.port);
    }
}
async function host(filename, options) {
    let files = [path.join(__dirname, "html")];
    if (options.assets) {
        files = [options.assets, ...files];
    }
    const server = new WebSocketHost({assets: files, port: options.port});
    let file;
    if (filename) {
        file = fs.readFileSync(filename).toString();
    } else {
        file = await read_stdin();
    }
    server.host_table("data_source_one", table(file));
    if (options.open) {
        open_browser(options.port);
    }
}
async function host ( filename , options ) { let files = [ path . join ( __dirname , "html" ) ] ; if ( options . assets ) { files = [ options . assets , ... files ] ; } const server = new WebSocketHost ( { assets : files , port : options . port } ) ; let file ; if ( filename ) { file = fs . readFileSync ( filename ) . toString ( ) ; } else { file = await read_stdin ( ) ; } server . host_table ( "data_source_one" , table ( file ) ) ; if ( options . open ) { open_browser ( options . port ) ; } }
Host a Perspective on a web server.

@param {*} filename
@param {*} options
Host a Perspective on a web server .