0.3.44 • Published 7 months ago

treedoc v0.3.44

Weekly downloads
61
License
MIT
Repository
github
Last release
7 months ago

codecov

Treedoc

Treedoc is an abstraction for tree-structured file formats such as JSON, YAML, and XML. It defines a simple object model similar to DOM for XML. But as an abstraction, the model itself is format agnostic. With this abstraction, it decouples the application from particular formats for configuration, persistent and communication serialization, etc. This allows the application to switch to different formats easily.

This library is an implementation of Treedoc with typescript. It also includes a parser for JSONex as a reference implementation for Treedoc model.

Background

Data serialization / de-serialization for configuration, persistent and communication are critical parts for almost any applications. The text-based serialization formats become more and more popular due to its simplicity. The formats have been evolved for many generations, from proprietary implementation to XML, YAML, and JSON, etc. Usually, the decision of which format is critical as once it's decided, the application will be coupled with the format. To switch to different format will be a huge refactor effort. However, the particular format shouldn't be the critical decision and the format will keep evolving. So it's important to decouple the application from particular formats. Treedoc is the solution for this decoupling.

JSONex

JSONex is a JSON extension format that makes JSON more friendly for configuration and persistent. This is a typescript port from Java implementation. Please refer to JSONex spec for more details.

Usage

Basic Usage

import { TDJSONParser, TDJSONParserOption, TDNodeType } from 'treedoc';

const o1 = TDJSONParser.get().parse(new TDJSONParserOption(jsonStr)).toObject();

Advanced Usage

Please refer to the test class TDJsonParser.spec.ts for more details.

Live Demo

http://treedoc.org

License

Copyright 2019-2022 Treedoc.org Author/Developer: Jianwu Chen

Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.

0.3.44

7 months ago

0.3.39

8 months ago

0.3.38

8 months ago

0.3.37

9 months ago

0.3.36

10 months ago

0.3.42

7 months ago

0.3.41

7 months ago

0.3.40

7 months ago

0.3.43

7 months ago

0.3.35

1 year ago

0.3.34

1 year ago

0.3.33

1 year ago

0.3.31

1 year ago

0.3.32

1 year ago

0.3.30

2 years ago

0.3.29

2 years ago

0.3.28

2 years ago

0.3.27

2 years ago

0.3.26

2 years ago

0.3.25

2 years ago

0.3.24

2 years ago

0.3.23

3 years ago

0.3.22

3 years ago

0.3.21

3 years ago

0.3.20

3 years ago

0.3.19

3 years ago

0.3.18

3 years ago

0.3.17

3 years ago

0.3.16

3 years ago

0.3.14

3 years ago

0.3.13

3 years ago

0.3.12

3 years ago

0.3.11

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.2.200803

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.200719

4 years ago

0.2.10

4 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.9

4 years ago

0.2.8

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.16

4 years ago

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago