1.0.2 • Published 3 years ago

rpg-generator v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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 folder.

TemplateLanguageDescription
rpgwsRPGLERPGLE 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:

VariableDescription
projectNameRPG 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.

ArgumentsDefaultDescription
RPG_pathCurrent directoryPath where new RPG folder should be created
RPG_nameRPG project name

Use as API

const RPG = require('RPGGen');

RPG.prompt(destination, srcTemplates, name)
  .then(() => {
    console.log('generated');
  })
  .catch(console.log);
ArgumentsDefaultDescription
destinationCurrent directoryPath where new folder should be created
srcTemplates../templatesRPG templates directory
nameRPG project name

You can test your code with:

$ 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 @Precogs-com