4.0.2 • Published 6 years ago

solfegejs-cli v4.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
6 years ago

solfegejs-cli

Command Line Interface of SolfegeJS

Installation

The bundle is included by default in SolfegeJS. You don't need to install it.

See SolfegeJS

Available commands

In order to expore commands, you need to create a console.js file:

const solfege = require("solfegejs");

// Initialize the application
let application = solfege.factory();

// Start the application
// The first 2 parameters are removed (node and the script)
application.start(process.argv.slice(2));

Expose a command

To expose a command, you have to create a service with a specific tag:

services:
    my_command:
        class: "Command/MyCommand"
        tags:
            - { name: "solfege.console.command" }

And your class must implement 2 methods (getName and execute):

export default class MyCommand
{
    getName()
    {
        return "my-command";
    }

    *execute(parameters, options)
    {
        console.log("My command executed");
    }
}

Now you can call your command like that:

node console.js my-command
4.0.2

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.4.3

9 years ago

1.4.2

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago