Function Decorator
Thefunction decorator is used to define graph-sitter functions within your application. It allows you to specify a name for the function that will be ran making it easier to run specific codemods
Usage
To use thefunction decorator, simply annotate your function with @graph_sitter.function and provide a name as an argument.
Example
run is decorated with @graph_sitter.function and given the name 'my-function'. This name will be used when the function is ran.
Parameters
name(str): The name of the function to be used when ran.
Description
Thefunction decorator is part of the graph-sitter SDK CLI and is used to mark functions that are intended to be ran as part of a code generation process. It ensures that the function is properly registered and can be invoked with the specified name.
CLI Examples
Running a Function
To run a deployed function using the CLI, use the following command:my-function.
See Also
- Codebase Visualization: For visualizing codebases in your application.
- CLI Init Command: For initializing projects or environments related to the function decorator.
- CLI Create Command: For creating new functions or projects using the CLI.
- CLI Run Command: For running code or scripts using the CLI.