Function
Static Public Summary | ||
public |
cliWithName(name: string): Provider Generates a |
|
public |
Generate a |
|
public |
promptWithOptions(messagesPrefix: string): Provider Generates a |
|
public |
tempFilesCustom(directory: string, locationName: string, serviceName: string): Provider Generates a Provider with a custom directory and/or location name for the temp directory. |
Static Public
public cliWithName(name: string): Provider source
import {cliWithName} from 'projext/src/services/cli/cli.js'
Generates a Provider
with an already defined name for the program.
Params:
Name | Type | Attribute | Description |
name | string | The name of the program. |
Example:
// Generate the provider
const provider = cliWithName('my-program');
// Register it on the container
container.register(provider);
// Getting access to the service instance
const cli = container.get('cli');
public plugins(prefix: string): Provider source
import {plugins} from 'projext/src/services/common/plugins.js'
Generate a Provider
with an already defined prefix for the plugins.
Params:
Name | Type | Attribute | Description |
prefix | string | The prefix the dependencies need to have in order to be identified as plugins. |
Example:
// Generate the provider
const provider = plugins('my-plugin-');
// Register it on the container
container.register(provider);
// Getting access to the service instance
const plugins = container.get('plugins');
public promptWithOptions(messagesPrefix: string): Provider source
import {promptWithOptions} from 'projext/src/services/common/prompt.js'
Generates a Provider
with an already defined message prefix.
Params:
Name | Type | Attribute | Description |
messagesPrefix | string |
|
A prefix to include in front of all the messages. |
Example:
// Generate the provider
const provider = promptWithOptions('my-prefix');
// Register it on the container
container.register(provider);
// Getting access to the service instance
const prompt = container.get('prompt');
public tempFilesCustom(directory: string, locationName: string, serviceName: string): Provider source
import {tempFilesCustom} from 'projext/src/services/common/tempFiles.js'
Generates a Provider with a custom directory and/or location name for the temp directory. You can also specify a custom service name, which can be helpfull if you want to create multiple services for temp files.
Params:
Name | Type | Attribute | Description |
directory | string |
|
The name of the temp directory. |
locationName | string |
|
The name that will be used to register the temp
directory path as a location on the |
serviceName | string |
|
The name that will be used to register the TempFiles instance as a service. |
Example:
// Generate the provider
const provider = tempFilesCustom('.my-files', 'myTempFiles', 'myTempFiles');
// Register it on the container
container.register(provider);
// Get access to the service instance
const myTempFiles = container.get('myTempFiles');