2.2.1 • Published 6 years ago

surfaces_txt2yaml v2.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

surfaces_txt2yaml

surfaces.txt -> surfaces.yaml

Installation

this requires js-yaml

npm install -g surfaces_txt2yaml

Usage

surfaces_txt2yaml surfaces.txt -o surfaces.yaml

or use this on your program ...

var fs = require('fs');
var SurfacesTxt2Yaml = require('surfaces_txt2yaml');
var txt_str = fs.readFileSync('surfaces.txt', 'utf8');
var yaml = SurfacesTxt2Yaml.txt_to_yaml(txt_str, {compatible: 'ssp-lazy'});
fs.writeFileSync('surfaces.yaml', yaml, 'utf8');

or use this on the browsers ...

<script src="js-yaml.min.js"></script>
<script src="surfaces_txt2yaml.js"></script>
...
var yaml = SurfacesTxt2Yaml.txt_to_yaml(txt_str, {compatible: 'ssp-lazy'});

surfaces_txt2yaml command currently supports only utf-8 input/output. If you want to input Shift_JIS text, use encoding.js or some other text encoding libraries.

Demo

http://narazaka.github.io/surfaces_txt2yaml/

APIs

yaml = SurfacesTxt2Yaml.txt_to_yaml(txt_str, options)

convert surfaces.txt format string to surfaces.yaml format string

obj = SurfacesTxt2Yaml.txt_to_data(txt_str, options)

convert surfaces.txt format string to surfaces.yaml like object

options

--output, -o
        output (default: stdout)

options below is same name as API options

--lint, -v
        validation only

--compatible, -c
        set all options to parse surfaces.txt as [materia/ssp(default)/ssp-lazy] compatible

--charset, -C
        enable charset setting parse

--check_seriko, -a
        check seriko version [warn/throw]

--allow_all_seriko, -A
        accept any seriko version with ignoring "version" property

--surface_definition, -S
        parse surface definition as [materia/ssp/ssp-lazy] compatible

--check_surface_scope_duplication, -d
        check surface scope duplication [warn/throw]

--check_nonstandard_comment, -n
        check nonstandard comment [warn/throw]

--comment_prefix, -p
        comment prefix (default: "//")
        -p "//,#,;"

surfaces.yaml

see surfaces_yaml

2.2.1

6 years ago

2.2.0

6 years ago

2.1.0

9 years ago

2.0.9

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.0

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.1

10 years ago