yaml-js

WebJar for yaml-js

Лицензия

Лицензия

Категории

Категории

JavaScript Языки программирования
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

yaml-js
Последняя версия

Последняя версия

0.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

yaml-js
WebJar for yaml-js
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/connec/yaml-js

Скачать yaml-js

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/yaml-js/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>yaml-js</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/yaml-js/
implementation 'org.webjars.bower:yaml-js:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.bower/yaml-js/
implementation ("org.webjars.bower:yaml-js:0.2.0")
'org.webjars.bower:yaml-js:jar:0.2.0'
<dependency org="org.webjars.bower" name="yaml-js" rev="0.2.0">
  <artifact name="yaml-js" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='yaml-js', version='0.2.0')
)
libraryDependencies += "org.webjars.bower" % "yaml-js" % "0.2.0"
[org.webjars.bower/yaml-js "0.2.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

yaml-js

NPM

yaml-js is a YAML loader and dumper, ported pretty much line-for-line from PyYAML. The goal for the project is to maintain a reliable and specification-complete YAML processor in pure Javascript, with CoffeeScript source code. You can try it out here.

Current Status

The library is being actively maintained for issues, and rather less actively developed for new/improved features.

Loading is stable and well-used, and passes the yaml-spec test suite, which fairly thoroughly covers the YAML 'core' schema (if you notice anything missing, create an issue).

Dumping is present but very lightly tested (auto-tests only, no significant usage). The output should therefore be correct YAML, however formatting is currently entirely untested.

If you use the library and find any bugs, or have any suggestions, don't hesitate to create an issue.

How Do I Get It?

npm install yaml-js

How Do I Use It?

// Server (e.g. node.js)
var yaml = require('yaml-js');

// Browser
// <script src='yaml.min.js'></script>

// Loading
console.log(yaml.load(
  '---\n' +
  'phrase1:\n' +
  '  - hello\n' +
  '  - &world world\n' +
  'phrase2:\n' +
  '  - goodbye\n' +
  '  - *world\n' +
  'phrase3: >\n' +
  '  What is up\n' +
  '  in this place.'
));
// { phrase1: [ 'hello', 'world' ],
//   phrase2: [ 'goodbye', 'world' ],
//   phrase3: 'What is up in this place.' }

// Dumping
console.log(yaml.dump({
  phrase1: [ 'hello',   'world' ],
  phrase2: [ 'goodbye', 'world' ],
  phrase3: 'What is up in this place.'
}));
// phrase1: [hello, world]
// phrase2: [goodbye, world]
// phrase3: What is up in this place.

API summary

Method Description
load Parse the first YAML document in a stream and produce the corresponding Javascript object.
dump Serialize a Javascript object into a YAML stream.
load_all Parse all YAML documents in a stream and produce the corresponing Javascript objects.
dump_all Serialize a sequence of Javascript objects into a YAML stream.
scan Scan a YAML stream and produce tokens.
parse Parse a YAML stream and produce events.
compose Parse the first YAML document in a stream and produce the corresponding representation tree.
compose_all Parse all YAML documents in a stream and produce corresponding representation trees.
emit Emit YAML parsing events into a stream.
serialize Serialize a representation tree into a YAML stream.
serialize_all Serialize a sequence of representation trees into a YAML stream.

License

WTFPL

Версии библиотеки

Версия
0.2.0