YAML (又名 YAML)?
如果这个曾经存在过,那么它一定已经被抹去了,因为最新的搜索结果一无所获。 看起来有很多实现仅从 Javascript 转储到 YAML 输出,但很难找到同时支持转储和加载的实现。
有没有人在做这样的事情……或者是需求太低了。
Does such a thing exist for YAML (aka YAML)?
If this existed at one time, it must have been obliterated because the latest search turned up nada. It looks like there are plenty of implementations that dump from Javascript to YAML output only, but having trouble finding an implementation that supports both dump and load.
Is anyone working on such a thing ... or is the demand simply far too low for this.
发布评论
评论(6)
只是在寻找相同的东西,这是一个基本的 基于 Javascript 的 YAML 解析器 编写的Tj Holowaychuk 在 refactormycode.com。 我在此处复制它以确保它不会丢失,似乎 yaml.org 上的 JsYaml 链接已损坏一段时间。 还没有测试过。
Was just looking for the same, here's a basic Javascript-based YAML parser written by Tj Holowaychuk over at refactormycode.com. I'm duplicating it here to ensure it isn't lost, appears the JsYaml link on yaml.org has been broken a while. Haven't tested it yet.
可能是较新版本的 js-yaml:
http://github.com/visionmedia/js-yaml
Possibly newer version of js-yaml here:
http://github.com/visionmedia/js-yaml
我更新这个问题以提供我自己研究的另一个解决方案:https://github.com/jeremyfa/yaml。 支持
它是 Symfony YAML 组件 (YAML 1.2) 的纯 JavaScript 端口,并且 装载和倾倒。 希望这可以帮助。
I update this question to give another solution that myself worked on: https://github.com/jeremyfa/yaml.js
It is a pure javascript port of Symfony YAML Component (YAML 1.2) and supports both loading and dumping. Hope this helps.
我不确定在哪里可以找到支持转储但不加载的“大量实现” - 就 JSON 是 YAML 1.2 的适当子集而言,我猜可能会有很多,但该子集使得YAML 不太人性化,尤其是对于复杂的数据结构。 我发现的大多数链接都是 JS-YAML 的 github 分支,这些分支依赖于 node.js 和/或仅提供解析器。
Jeremy Faivre 在 bitbucket 上的 yaml.js 在独立的 javascript 中实现了 YAML 的转储和加载(我从相关 stackoverflow 问题的答案中找到了它。 它没有得到积极维护,但似乎对于中等复杂的 YAML 和/或 javascript 对象工作得很好。
I'm not sure where the "plenty of implementations" that support dump but not load are to be found - to the extent that JSON is a proper subset of YAML 1.2, I guess there might be plenty of those, but that subset makes for YAML that is not particular human friendly, especially for complex data structures. Most of the links I have found are to github forks of JS-YAML that depend on node.js and/or only provide parsers.
Jeremy Faivre's yaml.js on bitbucket implements both dump and load of YAML in standalone javascript (I found it from an answer to a related stackoverflow question). It is not actively maintained, but seems to work fine for moderately complex YAML and/or javascript objects.
yaml-javascript 假装既是转储器又是解析器。 从未尝试过。
yaml-javascript pretends to be both dumper and parser. Never tried.
还有这个 javascript-yaml-parser/< /a>
看到这个问题:JavaScript YAML Parser,Diogo Costa 说:
可用的 javascript YAML 解析器都无法满足我的需求,因此我开发了自己的解析器:它可以在此处使用: http://code.google.com/p/javascript-yaml-parser/
There's also this javascript-yaml-parser/
See this question: JavaScript YAML Parser, Diogo Costa says:
None of the javascript YAML parsers available satisfied my needs so I developed my own: It is available here: http://code.google.com/p/javascript-yaml-parser/