# rpg-generator

> Generate a RPG boilerplate. Make your own personnal templates in a easier way!

Latest version **1.0.2** (published 2021-07-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install rpg-generator
pnpm add rpg-generator
yarn add rpg-generator
bun add rpg-generator
```

Provides the command `RPGGen`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-07-01 |
| First published | 2021-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0.0 |
| Dependencies | 5 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | sagartyagi.tyagi@gmail.com |
| Maintainers | gajendertyagi |
| Keywords | boilerplate, RPGLE, template, CLI |

## Links

- npm: https://www.npmjs.com/package/rpg-generator
- Repository: https://github.com/sagartyagi121/RPG-GENERATOR
- Issues: https://github.com/sagartyagi121/RPG-GENERATOR/issues
- npm.io page: https://npm.io/package/rpg-generator

## Dependencies (5)

- [ect](https://npm.io/package/ect.md) ^0.5.9
- [fs-extra](https://npm.io/package/fs-extra.md) ^5.0.0
- [inquirer](https://npm.io/package/inquirer.md) ^5.0.1
- [commander](https://npm.io/package/commander.md) ^2.14.1
- [inquirer-path](https://npm.io/package/inquirer-path.md) ^1.0.0-beta5

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-07-01
- 1.0.1 — 2021-07-01
- 1.0.0 — 2021-07-01

## README

# RPG-GENERATOR a simple rpg source bilerplate 

## Description

Simple generator of RPG boilerplate. You can either use predefined boilerplate (see list below), or add your owns.

## Requirements
Nodejs > 6.0.0

## Installation
```
npm install -g rpg-generator

RPGGen 
```
>> Answer all the prompts 

## Templates

### Default templates

Default templates are stored in [template](./templates) folder.

| Template | Language | Description |
| ------ | ------ | ------ |
| rpgws | RPGLE | RPGLE webservice template |

### Use your own templates
As RPG-boilerplate can be used as a CLI, you can define your own templates directory path. You just have to export your templates directory path `RPG_TEMPLATES_PATH` environment variable.

```
$ export RPG_TEMPLATES_PATH=/absolute/path/to/your/templates/directory
```

You can also add this line to your bash profile to keep it permanent.

### Template variable

For templating, we use ECT library. Following variables are availables:

| Variable | Description |
| ------ | ------ |
| projectName | RPG name |

## Use as CLI
```
$ RPGGen --help

  Usage: RPGGen [options] [RPG_path] [RPG_name]

  Generate a RPG boilerplate from template

  Options:

    -V, --version  output the version number
    -h, --help     output usage information
```

If it sets, CLI use `RPG_TEMPLATES_PATH` environment variable as templates directory path, otherwise it uses local [templates directory](./templates).

| Arguments | Default | Description |
| ------ | ------ | ------ |
| RPG_path | Current directory | Path where new RPG folder should be created |
| RPG_name |   | RPG project name |

## Use as API

```js
const RPG = require('RPGGen');

RPG.prompt(destination, srcTemplates, name)
  .then(() => {
    console.log('generated');
  })
  .catch(console.log);
```

| Arguments | Default | Description |
| ------ | ------ | ------ |
| destination | Current directory | Path where new folder should be created |
| srcTemplates | [../templates](./templates) | RPG templates directory |
| name |   | RPG project name |


You can test your code with:
```bash
$ git clone git@github.com:sagartyagi121/RPG-GENERATOR.git
$ cd RPG-GENERATOR
$ npm i 
$ npm run lint
$ npm run test
```

## TODO
- Add more templates
- Support ECT variables as parameters

Inspired by [@harrietty](https://medium.com/northcoders/creating-a-project-generator-with-node-29e13b3cd309)
            [@Precogs-com](https://github.com/Precogs-com/lambda-boilerplate)

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