# @observablehq/stdlib
[![Node CI](https://github.com/observablehq/stdlib/workflows/Node%20CI/badge.svg)](https://github.com/observablehq/stdlib/actions?workflow=Node+CI)
The Observable standard library.
For examples, see https://observablehq.com/@observablehq/stdlib.
## API Reference
* [DOM](#dom) - create HTML and SVG elements.
* [Files](#files) - read local files into memory.
* [FileAttachments](#file-attachments) - read remote files.
* [Generators](#generators) - utilities for generators and iterators.
* [Promises](#promises) - utilities for promises.
* [require](#require) - load third-party libraries.
* [html](#html) - render HTML.
* [md](#markdown) - render Markdown.
* [svg](#svg) - render SVG.
* [tex](#tex) - render LaTeX.
* [now](#now) - the current value of Date.now.
* [width](#width) - the current page width.
* [invalidation](#invalidation) - dispose resources.
* [visibility](#visibility) - wait for visibility.
### DOM
# DOM.canvas(width, height) [<>](https://github.com/observablehq/stdlib/blob/main/src/dom/canvas.js "Source")
Returns a new canvas element with the specified *width* and *height*. For example, to create a 960×500 canvas:
```js
DOM.canvas(960, 500)
```
This is equivalent to using the [html](#html) tagged template literal:
```js
html`