MCPcopy Create free account
hub / github.com/asg017/observable-prerender / getNotebookConfig

Function getNotebookConfig

bin/utils.js:107–123  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

105}
106
107function getNotebookConfig(opts) {
108 let { width, height, headless, browserWsendpoint, token } = opts;
109
110 if (width) width = +width;
111 if (height) height = +height;
112
113 const config = {
114 width,
115 height,
116 headless,
117 browserWSEndpoint: browserWsendpoint,
118 };
119
120 if (token) config["OBSERVABLEHQ_API_KEY"] = token;
121
122 return config;
123}
124
125// read the file found at path with the given format
126async function valueOfFile(path, format) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected