项目作者: Harvzor

项目描述 :
Fusion Markup Language is a fusion of existing markup languages.
高级语言: JavaScript
项目地址: git://github.com/Harvzor/fusion-markup-language.git
创建时间: 2020-01-31T11:41:22Z
项目社区:https://github.com/Harvzor/fusion-markup-language

开源协议:MIT License

下载


Build Status
codecov
npm version

Fusion Markup Language

One markup language to rule them all, One markup language to find them, One markup language to bring them all and in the darkness bind them

fusion-markup-language logo

What?

Fusion Markup Language combines the most popular markup languages into one language:

  1. {
  2. "person": {
  3. <name>
  4. <firstName>Rick</firstName>
  5. <lastName>Astley</lastName>
  6. </name>
  7. }
  8. }

Fusion Markup Language allows you to embed json and xml in the same string, this new format is called FML.

How?

Get FML:

  1. npm install fusion-markup-language

Parse some fml in the same way as you would use JSON.parse():

  1. const FML = require('fusion-markup-language')
  2. const personObject = FML.parse(`
  3. <?xml version="1.0" encoding="UTF-8" ?>
  4. <person>
  5. {
  6. "name": {
  7. "firstName": "Rick",
  8. "lastName": "Astley"
  9. }
  10. }
  11. </person>
  12. `)
  13. console.log(personObject)

Why?

When it comes to markup languages, developers are spoiled with choice, such as csv, xml, json, yaml and toml. But why should we pick just one?

Fusion Markup Language attempts to provide an all-in-one solution that can fit any size project.

When you’re stuck deciding which markup language, just think FML!