# b5g

> Convenience package to generate templates around Bve5 syntax

Latest version **0.1.2** (published 2022-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install b5g
pnpm add b5g
yarn add b5g
bun add b5g
```

Provides the command `b5g`.

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2022-04-21 |
| First published | 2019-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 167.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | aoisupersix |
| Maintainers | aoisupersix |
| Keywords | bve5 |

## Links

- npm: https://www.npmjs.com/package/b5g
- Repository: https://github.com/aoisupersix/B5G
- Homepage: https://github.com/aoisupersix/B5G#readme
- Issues: https://github.com/aoisupersix/B5G/issues
- npm.io page: https://npm.io/package/b5g

## Dependencies (7)

- [fs](https://npm.io/package/fs.md) 0.0.2
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [commander](https://npm.io/package/commander.md) ^9.2.0
- [handlebars](https://npm.io/package/handlebars.md) ^4.7.7
- [typescript](https://npm.io/package/typescript.md) ^4.6.3
- [handlebars-helpers](https://npm.io/package/handlebars-helpers.md) ^0.9.8

## Recent versions

- 0.1.2 (latest) — 2022-04-21
- 0.1.1 — 2022-04-21
- 0.1.0 — 2022-04-21
- 0.0.4 — 2022-04-17
- 0.0.3 — 2019-08-08
- 0.0.2 — 2019-08-01
- 0.0.1 — 2019-07-31

## README

[![CI](https://github.com/aoisupersix/B5G/actions/workflows/ci.yml/badge.svg)](https://github.com/aoisupersix/B5G/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/aoisupersix/B5G/badge.svg?branch=master)](https://coveralls.io/github/aoisupersix/B5G?branch=master)
[![npm version](https://badge.fury.io/js/b5g.svg)](https://badge.fury.io/js/b5g)

# B5G

Bve5 の構文定義ファイルを Mustache のテンプレートファイルに食わせてドキュメントを生成するオレオレ npm パッケージです。
OpenAPI みたいに YAML 定義から様々な定義を自動生成したかったので。

# Installation

```sh
npm install -g b5g
```

# Usage

## CLI

```
b5g --help

Usage: b5g [options] [command]

generate artifact documents with embedded BveTranSim syntax definitions from template file.

Options:
  -h, --help                               display help for command

Commands:
  render [options] <source> [destination]  render to the template file.
  generate [options] [destination]         generate MapData.
  help [command]                           display help for command
```

### Rendering a template file

```sh
b5g render ./template.mst ./rendered.txt
```

### Generate custom syntax definition

```sh
b5g generate -d ./definition.yml ./syntaxdefinition.json
```

## Program

```js
import { render, getDefaultMapData } from 'b5g'
import fs from 'fs'

getDefaultMapData()
    .then((map) => {
        fs.readFileSync('./templatefile.mst', 'utf-8')
        const rendered = render(template, mapData)
        fs.writeFile('./renderedfile.txt', rendered)
    })
    .catch((err) => console.error(err))
```

# Supported Handlebar helpers

[handlebars-helpers](https://github.com/helpers/handlebars-helpers)

# Grammar Documentation & Sample

-   Documentation: https://aoisupersix.github.io/B5G
-   JSON Schema: https://aoisupersix.github.io/B5G/json-schema.json
-   Generated JSON file: https://aoisupersix.github.io/B5G/generated.json

---
_Source: https://npm.io/package/b5g · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
