lrequire: Sources an R "Module" with Caching & Encapsulation, Returning Exported Vars

Share:

In the fashion of 'node.js' <https://nodejs.org/>, requires a file, sourcing into the current environment only the variables explicitly specified in the module.exports or exports list variable. If the file was already sourced, the result of the earlier sourcing is returned to the caller.

Author
Rick Wargo <lrequire@rickwargo.com>
Date of publication
2016-02-22 08:04:15
Maintainer
Rick Wargo <lrequire@rickwargo.com>
License
MIT + file LICENSE
Version
0.1.3
URLs

View on CRAN

Man pages

append.module.paths
Append/Insert a path into module.paths, similar to append()
find.first.R
Returns the path of the first found instance of 'module' in...
get.module.cache
Returns the current file cache
get.module.paths
Get existing collection of search paths of where to look for...
hide.not.found.warnings
Globally hide warnings when modules are not found
lrequire
Sources an R module with optional caching for subsequent...
remove.from.module.cache
Removes module from cache, applying same logic as...
remove.module.paths
Remove one or more paths from 'module.paths'
reset.module.cache
Resets the module cache, ensuring files are loaded on next...
show.module.cache
Prints the current file cache
show.not.found.warnings
Globally show warnings when modules are not found

Files in this package

lrequire
lrequire/tests
lrequire/tests/testthat.R
lrequire/tests/testthat
lrequire/tests/testthat/test-06-module_paths_functions.R
lrequire/tests/testthat/hello_ex.R
lrequire/tests/testthat/exports.R
lrequire/tests/testthat/single-function-encapsulation.R
lrequire/tests/testthat/test-05-cache_functions.R
lrequire/tests/testthat/test-01-encapsulation.R
lrequire/tests/testthat/test-04-reload_and_caching.R
lrequire/tests/testthat/test-03-exports.R
lrequire/tests/testthat/test-02-single-function-encapsulation.R
lrequire/tests/testthat/encapsulation.R
lrequire/NAMESPACE
lrequire/NEWS
lrequire/R
lrequire/R/getcache.R
lrequire/R/findfirst.R
lrequire/R/removefromcache.R
lrequire/R/lrequire.R
lrequire/R/resetcache.R
lrequire/R/showcache.R
lrequire/R/modulepaths.R
lrequire/R/variables.R
lrequire/README.md
lrequire/MD5
lrequire/DESCRIPTION
lrequire/man
lrequire/man/show.not.found.warnings.Rd
lrequire/man/find.first.R.Rd
lrequire/man/lrequire.Rd
lrequire/man/show.module.cache.Rd
lrequire/man/get.module.paths.Rd
lrequire/man/append.module.paths.Rd
lrequire/man/remove.module.paths.Rd
lrequire/man/reset.module.cache.Rd
lrequire/man/get.module.cache.Rd
lrequire/man/remove.from.module.cache.Rd
lrequire/man/hide.not.found.warnings.Rd
lrequire/LICENSE