@sanghak/dokdo-cli

1.0.0 • Public • Published

Dokdo CLI

npm License

A library that generates JavaScript class builders based on JSON Schema using the @sanghak/dokdo class.

Usage

$ npm install -g @sanghak/dokdo-cli

$ dokdo-cli user.json
Class user generated at user.js
# user.json
{
    "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
        "firstName": { "type": "string" },
        "lastName": { "type": "string" },
        "email": { "type": "string" },
        "money": { "type": "number" }
    },
    "required": ["firstName", "lastName", "email", "money"]
}

$ dokdo-cli user.json
Class user generated at user.js


# user.js
class user extends Builder(class {
  constructor(builder = {}) {

    this.firstName = builder.firstName;
    this.lastName = builder.lastName;
    this.email = builder.email;
    this.money = builder.money;
  }
}) {}

Options

  • -c, --className : Specify the class name for the generated class. (default: JSON Schema filename)
  • -d, --dokdoClassName : Specify the parent class name (default: Builder).
  • -b, --builderName : Specify the builder object name (default: builder).
  • -o, --output : Specify the output file path. (default: JSON Schema file path)
  • -s, --style <style>: Specify the naming style (js or java, default: js).**

Readme

Keywords

Package Sidebar

Install

npm i @sanghak/dokdo-cli

Weekly Downloads

0

Version

1.0.0

License

GPL-3.0

Unpacked Size

46.2 kB

Total Files

7

Last publish

Collaborators

  • sanghaklee