1.0.5 • Published 2 years ago

tpl-generator v1.0.5

Weekly downloads
1
License
ISC
Repository
-
Last release
2 years ago

tpl-generator

base on lodash template to generate file

.json as context and .tpl with same name source file

out field as output dir target

useage

npm i -g tpl-generator

tpl-g

example

mkdir .tpldir

touch g.json g.tpl

# g.json
[
    {
        "path": ["a","b"],
        "method": "post",
        "params": {"name": "user", "type": "string"},
        "out": {"name": "./g/test.java"}
    },
]

# g.tpl
<% _.forEach(path, (item, index) => { %>

    console.log(<%= item %>, <%= index %>)

<% }) %>

<%= params.name %>

<%= params.type %>
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago