Elm:读取文件内容 [英] elm: read file content

查看:89
本文介绍了Elm:读取文件内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法读取 elm 中的文件?

Is there a way to read a file in elm?

我想拥有一个 xml 设置文件,我将保留不同的设置并用Elm读取(我已经看过这个解析器,但它期望 xml 内容,而不是路径)。我不想使用端口和这些东西。我需要对此 xml 进行一些转换,因为我将拥有更多的值集(分段和生产),并且需要为每个值生成伪像(我是对此使用 TFS )。

I want to have an xml settings file where I will keep different settings and read it with elm (I've seen this parser, but it expects the xml content, not path). I don't want to use ports and these stuff. I need to apply some transformations to this xml because I will have more sets of values (staging and production) and I will need to generate an artefact for each value (I'm using TFS for this).

推荐答案

今天( 0.18.0 ),则正式Elm不支持文件API 和其他文件相关的API。

As of today (0.18.0), officially Elm does not support File API and other file-related APIs.

您只能通过WebSocket或通过HTTP执行I / O。

You can perform I/O only through WebSockets or over HTTP.

端口覆盖。

这篇关于Elm:读取文件内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆