Skip to content

Support FileAttachment in local ES modules #15

@mbostock

Description

@mbostock

It’d be nice if you could use file attachments in local ES modules. I’m imagining it would work like this:

import {FileAttachment} from "npm:@observablehq/stdlib";

const foo = await FileAttachment("foo.csv").json();

In this case, the path foo.csv would be relative to the current ES module.

The dual meaning of importing the Observable standard library would be a little odd, though. I’m not sure how that would work… and maybe this is a pipe dream.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions