-
Hi, Can we use the FileAttachment API from nodejs, in order to easily move logic from I have a few Excel file loads, and dropping down to But it would be much nicer if I can just use the FileAttachment API in nodejs. I tried:
but Any pointers much appreciated! Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This isn’t currently supported, no. You can use https://github.com/observablehq/framework/tree/main/src/client/stdlib For reading Excel files: https://github.com/observablehq/framework/blob/main/src/client/stdlib/xlsx.js I’d like to extract this code from Framework and publish it to npm; please upvote #852 if you are interested in this feature. |
Beta Was this translation helpful? Give feedback.
This isn’t currently supported, no. You can use
readFile
fromfs
to read files in Node.js, and you’re free to copy the helper methods for parsing out of our standard library. But, be aware that Framework doesn’t actually use@observablehq/stdlib
for the standard library; we instead forked it to create a new version for Framework:https://github.com/observablehq/framework/tree/main/src/client/stdlib
For reading Excel files:
https://github.com/observablehq/framework/blob/main/src/client/stdlib/xlsx.js
I’d like to extract this code from Framework and publish it to npm; please upvote #852 if you are interested in this feature.