Skip to content

Commit 25d986d

Browse files
gvanhornembostock
andauthored
Add version badge to docs referencing file.size (#1641)
* Add version badge to docs referencing file.size * Add version badge for file.lastModified * Update files.md * edits --------- Co-authored-by: Mike Bostock <[email protected]>
1 parent 88e221d commit 25d986d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/files.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ Load files — whether static or generated dynamically by a [data loader](./data
1010
import {FileAttachment} from "npm:@observablehq/stdlib";
1111
```
1212

13-
The `FileAttachment` function takes a path and returns a file handle. This handle exposes the file’s name, [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types), size in bytes <a href="https://github.com/observablehq/framework/releases/tag/v1.11.0" class="observablehq-version-badge" data-version="^1.11.0" title="Added in 1.11.0"></a>, and modification time <a href="https://github.com/observablehq/framework/releases/tag/v1.4.0" class="observablehq-version-badge" data-version="^1.4.0" title="Added in 1.4.0"></a> (represented as the number of milliseconds since UNIX epoch).
13+
The `FileAttachment` function takes a path and returns a file handle. This handle exposes:
14+
15+
* `name` - the file’s name (such as `volcano.json`),
16+
* `mimeType` - [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) (such as `application/json`),
17+
* `lastModified` - modification time <a href="https://github.com/observablehq/framework/releases/tag/v1.4.0" class="observablehq-version-badge" data-version="^1.4.0" title="Added in 1.4.0"></a> (in milliseconds since epoch), and
18+
* `size` - size in bytes <a href="https://github.com/observablehq/framework/releases/tag/v1.11.0" class="observablehq-version-badge" data-version="^1.11.0" title="Added in 1.11.0"></a>.
1419

1520
```js echo
1621
FileAttachment("volcano.json")

0 commit comments

Comments
 (0)