This function creates a module inside the R/
folder, based
on a specific module structure. This function can be used outside
of a {golem}
project.
add_module(
name,
pkg = get_golem_wd(),
open = TRUE,
dir_create = TRUE,
fct = NULL,
utils = NULL,
r6 = NULL,
js = NULL,
js_handler = NULL,
export = FALSE,
module_template = golem::module_template,
with_test = FALSE,
...
)
The name of the module.
Path to the root of the package. Default is get_golem_wd()
.
Should the created file be opened?
Creates the directory if it doesn't exist, default is TRUE
.
If specified, creates a mod_fct
file.
If specified, creates a mod_utils
file.
If specified, creates a mod_class
file.
If specified, creates a module related JavaScript file.
Should the module be exported? Default is FALSE
.
Function that serves as a module template.
should the module be created with tests?
Arguments to be passed to the module_template
function.
The path to the file, invisibly.
This function will prefix the name
argument with mod_
.