An Opinionated Framework for Using 'JavaScript'

Enforces good practice and provides convenience functions to make work with 'JavaScript' not just easier but also scalable. It is a robust wrapper to 'NPM', 'yarn', and 'webpack' that enables to compartmentalize 'JavaScript' code, leverage 'NPM' and 'yarn' packages, include 'TypeScript', 'React', or 'Vue' in web applications, and much more.


License GitHub tag (latest by date) R-CMD-check Codecov test coverage

Website | Installation | Get Started | Book

An opinionated framework for using JavaScript with R

At its core packer consists of functions to scaffold R packages powered by webpack and npm, these take the form of scaffolds which are built on top of packages. All of the scaffolds below thus need to be run from within an R package.

Things you can do with packer

  • Use npm packages with htmlwidgets
  • Create your shiny UI with the pug templating engine
  • Include React/Vue in you shiny application
  • Bundle JavaScript files for golem
  • Scope CSS selectors
  • Use Lit web components
  • And so much more...

Usage

Always start from an empty package and run scaffold_* to set up the required basic structure.

packer::scaffold_input("<name_of_input>")

Once the scaffold laid down you can either bundle the JavaScript or watch for changes as you develop it.

packer::bundle()

You can then document and install the package to try it out.

Install

Get the stable version from CRAN:

install.packages("packer")

Get the development version from Github with remotes.

# install.packages("remotes")
remotes::install_github("JohnCoene/packer")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("packer")

0.1.3 by John Coene, 4 years ago


https://github.com/JohnCoene/packer, https://packer.john-coene.com


Report a bug at https://github.com/JohnCoene/packer/issues


Browse source code at https://github.com/cran/packer


Authors: John Coene [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports fs, cli, usethis, jsonlite, roxygen2, rprojroot, rstudioapi, assertthat, htmlwidgets

Suggests testthat, covr, golem


Suggested by jqbr, leprechaun, waiter.


See at CRAN