├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ └── R-CMD-check.yaml ├── CRAN-SUBMISSION ├── DESCRIPTION ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── assertions.R └── npm.R ├── README.md ├── cran-comments.md ├── makefile └── man ├── does_exist.Rd ├── npm_audit.Rd ├── npm_find.Rd ├── npm_init.Rd ├── npm_install.Rd ├── npm_outdated.Rd ├── npm_path.Rd ├── npm_path_env_set.Rd ├── npm_run.Rd ├── npm_update.Rd ├── package_message.Rd ├── packages_flat.Rd └── system_2.Rd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^LICENSE\.md$ 2 | ^\.github$ 3 | makefile 4 | ^CRAN-SUBMISSION$ 5 | ^cran-comments\.md$ 6 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. 2 | # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | pull_request: 9 | branches: 10 | - main 11 | - master 12 | 13 | name: R-CMD-check 14 | 15 | jobs: 16 | R-CMD-check: 17 | runs-on: ${{ matrix.config.os }} 18 | 19 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | config: 25 | - {os: windows-latest, r: 'release'} 26 | - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} 27 | 28 | env: 29 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 30 | RSPM: ${{ matrix.config.rspm }} 31 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 32 | 33 | steps: 34 | - uses: actions/checkout@v2 35 | 36 | - uses: r-lib/actions/setup-r@v1 37 | with: 38 | r-version: ${{ matrix.config.r }} 39 | 40 | - uses: r-lib/actions/setup-pandoc@v1 41 | 42 | - name: Query dependencies 43 | run: | 44 | install.packages('remotes') 45 | saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) 46 | writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") 47 | shell: Rscript {0} 48 | 49 | - name: Cache R packages 50 | if: runner.os != 'Windows' 51 | uses: actions/cache@v2 52 | with: 53 | path: ${{ env.R_LIBS_USER }} 54 | key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} 55 | restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- 56 | 57 | - name: Install system dependencies 58 | if: runner.os == 'Linux' 59 | run: | 60 | while read -r cmd 61 | do 62 | eval sudo $cmd 63 | done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') 64 | 65 | - name: Install dependencies 66 | run: | 67 | remotes::install_deps(dependencies = TRUE) 68 | remotes::install_cran("rcmdcheck") 69 | shell: Rscript {0} 70 | 71 | - name: Check 72 | env: 73 | _R_CHECK_CRAN_INCOMING_REMOTE_: false 74 | run: | 75 | options(crayon.enabled = TRUE) 76 | rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") 77 | shell: Rscript {0} 78 | 79 | - name: Upload check results 80 | if: failure() 81 | uses: actions/upload-artifact@main 82 | with: 83 | name: ${{ runner.os }}-r${{ matrix.config.r }}-results 84 | path: check 85 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 1.0.0 2 | Date: 2022-01-18 20:02:03 UTC 3 | SHA: 490d8dca101b8e36b31fba57e8089ca718ff512b 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: npm 2 | Title: Interact with 'NPM' 3 | Version: 1.0.0.9000 4 | Authors@R: 5 | person(given = "John", 6 | family = "Coene", 7 | role = c("aut", "cre"), 8 | email = "jcoenep@gmail.com") 9 | Description: Interact with 'NPM' from the 'R Console' to automate 10 | tasks and ease access to 'JavaScript'. 11 | License: LGPL (>= 3) 12 | Encoding: UTF-8 13 | LazyData: true 14 | Roxygen: list(markdown = TRUE) 15 | RoxygenNote: 7.3.0 16 | Imports: 17 | assertthat, 18 | cli, 19 | erratum 20 | Remotes: 21 | devOpifex/erratum 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU Lesser General Public License 2 | ================================= 3 | 4 | _Version 3, 29 June 2007_ 5 | _Copyright © 2007 Free Software Foundation, Inc. <>_ 6 | 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | 10 | 11 | This version of the GNU Lesser General Public License incorporates 12 | the terms and conditions of version 3 of the GNU General Public 13 | License, supplemented by the additional permissions listed below. 14 | 15 | ### 0. Additional Definitions 16 | 17 | As used herein, “this License” refers to version 3 of the GNU Lesser 18 | General Public License, and the “GNU GPL” refers to version 3 of the GNU 19 | General Public License. 20 | 21 | “The Library” refers to a covered work governed by this License, 22 | other than an Application or a Combined Work as defined below. 23 | 24 | An “Application” is any work that makes use of an interface provided 25 | by the Library, but which is not otherwise based on the Library. 26 | Defining a subclass of a class defined by the Library is deemed a mode 27 | of using an interface provided by the Library. 28 | 29 | A “Combined Work” is a work produced by combining or linking an 30 | Application with the Library. The particular version of the Library 31 | with which the Combined Work was made is also called the “Linked 32 | Version”. 33 | 34 | The “Minimal Corresponding Source” for a Combined Work means the 35 | Corresponding Source for the Combined Work, excluding any source code 36 | for portions of the Combined Work that, considered in isolation, are 37 | based on the Application, and not on the Linked Version. 38 | 39 | The “Corresponding Application Code” for a Combined Work means the 40 | object code and/or source code for the Application, including any data 41 | and utility programs needed for reproducing the Combined Work from the 42 | Application, but excluding the System Libraries of the Combined Work. 43 | 44 | ### 1. Exception to Section 3 of the GNU GPL 45 | 46 | You may convey a covered work under sections 3 and 4 of this License 47 | without being bound by section 3 of the GNU GPL. 48 | 49 | ### 2. Conveying Modified Versions 50 | 51 | If you modify a copy of the Library, and, in your modifications, a 52 | facility refers to a function or data to be supplied by an Application 53 | that uses the facility (other than as an argument passed when the 54 | facility is invoked), then you may convey a copy of the modified 55 | version: 56 | 57 | * **a)** under this License, provided that you make a good faith effort to 58 | ensure that, in the event an Application does not supply the 59 | function or data, the facility still operates, and performs 60 | whatever part of its purpose remains meaningful, or 61 | 62 | * **b)** under the GNU GPL, with none of the additional permissions of 63 | this License applicable to that copy. 64 | 65 | ### 3. Object Code Incorporating Material from Library Header Files 66 | 67 | The object code form of an Application may incorporate material from 68 | a header file that is part of the Library. You may convey such object 69 | code under terms of your choice, provided that, if the incorporated 70 | material is not limited to numerical parameters, data structure 71 | layouts and accessors, or small macros, inline functions and templates 72 | (ten or fewer lines in length), you do both of the following: 73 | 74 | * **a)** Give prominent notice with each copy of the object code that the 75 | Library is used in it and that the Library and its use are 76 | covered by this License. 77 | * **b)** Accompany the object code with a copy of the GNU GPL and this license 78 | document. 79 | 80 | ### 4. Combined Works 81 | 82 | You may convey a Combined Work under terms of your choice that, 83 | taken together, effectively do not restrict modification of the 84 | portions of the Library contained in the Combined Work and reverse 85 | engineering for debugging such modifications, if you also do each of 86 | the following: 87 | 88 | * **a)** Give prominent notice with each copy of the Combined Work that 89 | the Library is used in it and that the Library and its use are 90 | covered by this License. 91 | 92 | * **b)** Accompany the Combined Work with a copy of the GNU GPL and this license 93 | document. 94 | 95 | * **c)** For a Combined Work that displays copyright notices during 96 | execution, include the copyright notice for the Library among 97 | these notices, as well as a reference directing the user to the 98 | copies of the GNU GPL and this license document. 99 | 100 | * **d)** Do one of the following: 101 | - **0)** Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | - **1)** Use a suitable shared library mechanism for linking with the 109 | Library. A suitable mechanism is one that **(a)** uses at run time 110 | a copy of the Library already present on the user's computer 111 | system, and **(b)** will operate properly with a modified version 112 | of the Library that is interface-compatible with the Linked 113 | Version. 114 | 115 | * **e)** Provide Installation Information, but only if you would otherwise 116 | be required to provide such information under section 6 of the 117 | GNU GPL, and only to the extent that such information is 118 | necessary to install and execute a modified version of the 119 | Combined Work produced by recombining or relinking the 120 | Application with a modified version of the Linked Version. (If 121 | you use option **4d0**, the Installation Information must accompany 122 | the Minimal Corresponding Source and Corresponding Application 123 | Code. If you use option **4d1**, you must provide the Installation 124 | Information in the manner specified by section 6 of the GNU GPL 125 | for conveying Corresponding Source.) 126 | 127 | ### 5. Combined Libraries 128 | 129 | You may place library facilities that are a work based on the 130 | Library side by side in a single library together with other library 131 | facilities that are not Applications and are not covered by this 132 | License, and convey such a combined library under terms of your 133 | choice, if you do both of the following: 134 | 135 | * **a)** Accompany the combined library with a copy of the same work based 136 | on the Library, uncombined with any other library facilities, 137 | conveyed under the terms of this License. 138 | * **b)** Give prominent notice with the combined library that part of it 139 | is a work based on the Library, and explaining where to find the 140 | accompanying uncombined form of the same work. 141 | 142 | ### 6. Revised Versions of the GNU Lesser General Public License 143 | 144 | The Free Software Foundation may publish revised and/or new versions 145 | of the GNU Lesser General Public License from time to time. Such new 146 | versions will be similar in spirit to the present version, but may 147 | differ in detail to address new problems or concerns. 148 | 149 | Each version is given a distinguishing version number. If the 150 | Library as you received it specifies that a certain numbered version 151 | of the GNU Lesser General Public License “or any later version” 152 | applies to it, you have the option of following the terms and 153 | conditions either of that published version or of any later version 154 | published by the Free Software Foundation. If the Library as you 155 | received it does not specify a version number of the GNU Lesser 156 | General Public License, you may choose any version of the GNU Lesser 157 | General Public License ever published by the Free Software Foundation. 158 | 159 | If the Library as you received it specifies that a proxy can decide 160 | whether future versions of the GNU Lesser General Public License shall 161 | apply, that proxy's public statement of acceptance of any version is 162 | permanent authorization for you to choose that version for the 163 | Library. 164 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(npm_audit) 4 | export(npm_init) 5 | export(npm_install) 6 | export(npm_outdated) 7 | export(npm_path_get) 8 | export(npm_path_set) 9 | export(npm_run) 10 | export(npm_update) 11 | importFrom(assertthat,assert_that) 12 | importFrom(cli,cli_process_done) 13 | importFrom(cli,cli_process_failed) 14 | importFrom(cli,cli_process_start) 15 | importFrom(erratum,bash) 16 | importFrom(erratum,e) 17 | importFrom(erratum,resolve) 18 | importFrom(erratum,w) 19 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # npm 1.0.0.9000 2 | 3 | * Initial version 4 | -------------------------------------------------------------------------------- /R/assertions.R: -------------------------------------------------------------------------------- 1 | #' Assertions 2 | #' 3 | #' @keywords internal 4 | does_exist <- function(x){ 5 | length(x) > 0 6 | } 7 | 8 | assertthat::on_failure(does_exist) <- function(call, env){ 9 | "Cannot find path to npm, see `npm_path_set`" 10 | } 11 | -------------------------------------------------------------------------------- /R/npm.R: -------------------------------------------------------------------------------- 1 | #' Set Path to NPM Installation 2 | #' 3 | #' Define the path to the NPM installation. By default, 4 | #' this should not be necessary, parcel will find the path 5 | #' by itself if NPM was installed correctly. 6 | #' 7 | #' @param path Path to NPM binary. 8 | #' 9 | #' @name npm_path 10 | #' @export 11 | npm_path_set <- function(path = Sys.getenv("NPM_PATH")){ 12 | assert_that(does_exist(path)) 13 | npm_path_env_set(path) 14 | } 15 | 16 | #' @describeIn npm_path Get NPM path 17 | #' @importFrom assertthat assert_that 18 | #' @export 19 | npm_path_get <- function(){ 20 | found <- npm_find() 21 | env <- npm_path_env_get() 22 | 23 | if(!is.null(env)) 24 | return(env) 25 | 26 | assert_that(does_exist(found)) 27 | found 28 | } 29 | 30 | #' NPM Path Environment 31 | #' @keywords internal 32 | npm_path_env_set <- function(path){ 33 | Sys.setenv(NPM_PATH = path) 34 | } 35 | 36 | #' @keywords internal 37 | npm_path_env_get <- function(){ 38 | path <- Sys.getenv("NPM_PATH") 39 | 40 | if(path == "") 41 | return() 42 | 43 | path 44 | } 45 | 46 | #' Find NPM 47 | #' 48 | #' Find path to NPM installation 49 | #' 50 | #' @keywords internal 51 | npm_find <- function(){ 52 | Sys.which("npm") 53 | } 54 | 55 | #' NPM Run 56 | #' 57 | #' @param ... arguments to pass to the `npm` command. 58 | #' 59 | #' @importFrom erratum bash resolve 60 | #' 61 | #' @return Invisibly returns the output of the command. 62 | #' 63 | #' @return Invisibly returns the output of the command 64 | #' as a `character` vector. 65 | #' 66 | #' @export 67 | npm_run <- function(...){ 68 | output <- bash(system_2(...)) 69 | resolve(output) 70 | invisible(output) 71 | } 72 | 73 | #' @keywords internal 74 | #' @importFrom cli cli_process_start cli_process_failed cli_process_done 75 | #' @importFrom erratum bash w e resolve 76 | npm_run_process <- function(..., s, d, f){ 77 | cli_process_start(s, d, f) 78 | output <- bash( 79 | system_2(...), 80 | w = function(war){ 81 | cli_process_done() 82 | w(war) 83 | }, 84 | e = function(err){ 85 | cli_process_failed() 86 | e(err) 87 | } 88 | ) 89 | 90 | resolve(output) 91 | 92 | cli_process_done() 93 | 94 | invisible(output) 95 | } 96 | 97 | #' Wrapper on System Call 98 | #' 99 | #' A soft wrapper on system call. 100 | #' 101 | #' @keywords internal 102 | system_2 <- function(..., stdout = TRUE, stderr = TRUE){ 103 | path <- npm_path_get() 104 | system2(path, c(...), stdout = stdout, stderr = stderr) 105 | } 106 | 107 | #' NPM Init 108 | #' 109 | #' Initialise an NPM project. 110 | #' 111 | #' @examples 112 | #' \dontrun{npm_init()} 113 | #' 114 | #' @return Invisibly returns the output of the command 115 | #' as a `character` vector. 116 | #' 117 | #' @export 118 | npm_init <- function(){ 119 | npm_run_process( 120 | "init", "-y", 121 | s = "Initialising npm", 122 | d = "Initialised npm", 123 | f = "Failed to initialise npm" 124 | ) 125 | } 126 | 127 | #' NPM Install 128 | #' 129 | #' @param ... Names of packages to install. 130 | #' @param scope Scope of the installation of the packages. 131 | #' This is ignored if no packages are passed to the three 132 | #' dots construct (`...`). 133 | #' 134 | #' @examples 135 | #' \dontrun{npm_install("browserify", scope = "global")} 136 | #' 137 | #' @return Invisibly returns the output of the command 138 | #' as a `character` vector. 139 | #' 140 | #' @export 141 | npm_install <- function( 142 | ..., 143 | scope = c( 144 | "dev", 145 | "prod", 146 | "exact", 147 | "global", 148 | "optional" 149 | ) 150 | ){ 151 | 152 | scope <- match.arg(scope) 153 | msgs <- package_message(...) 154 | scope <- scope2flag(scope) 155 | 156 | # override scope if no pkgs passed 157 | if(length(...) == 0) 158 | scope <- "" 159 | 160 | npm_run_process( 161 | "install", 162 | scope, 163 | ..., 164 | s = msgs$s, 165 | d = msgs$d, 166 | f = msgs$f 167 | ) 168 | } 169 | 170 | #' @keywords internal 171 | scope2flag <- function(scope = c("dev", "prod", "global")){ 172 | scope <- match.arg(scope) 173 | 174 | switch( 175 | scope, 176 | dev = "--save-dev", 177 | prod = "--save", 178 | global = "--global", 179 | optional = "--save-optional", 180 | exact = "--save-exact" 181 | ) 182 | } 183 | 184 | #' Package Installation Messages 185 | #' 186 | #' Creates messages for installation process. 187 | #' 188 | #' @keywords internal 189 | package_message <- function(...){ 190 | pkgs_flat <- packages_flat(...) 191 | 192 | list( 193 | s = sprintf("Installing %s", pkgs_flat), 194 | d = sprintf("Installed %s", pkgs_flat), 195 | f = sprintf("Failed to installed %s", pkgs_flat) 196 | ) 197 | } 198 | 199 | #' Flatten Packages 200 | #' 201 | #' Flatten packages for creating the message. 202 | #' 203 | #' @keywords internal 204 | packages_flat <- function(...){ 205 | pkgs <- c(...) 206 | 207 | pkgs_out <- "packages from {.val `package.json`}" 208 | if(length(pkgs) > 0) 209 | pkgs_out <- sapply(pkgs, function(pak){ 210 | sprintf("{.val `%s`}", pak) 211 | }) 212 | 213 | paste0(pkgs_out, collapse = ", ") 214 | } 215 | 216 | #' NPM Audit Fix 217 | #' 218 | #' Audit NPM packages and fix potential issues. 219 | #' 220 | #' @param fix Whether to also fix issues. 221 | #' 222 | #' @examples 223 | #' \dontrun{npm_audit()} 224 | #' 225 | #' @return Invisibly returns the output of the command 226 | #' as a `character` vector. 227 | #' 228 | #' @export 229 | npm_audit <- function(fix = FALSE){ 230 | fix_flag <- "" 231 | if(fix) fix_flag <- "fix" 232 | 233 | npm_run_process( 234 | "audit", 235 | fix_flag, 236 | s = "Auditing packages", 237 | d = "Audited packages", 238 | f = "Failed to audit packages" 239 | ) 240 | } 241 | 242 | #' Outdated Packages 243 | #' 244 | #' Get outdated NPM packages. 245 | #' 246 | #' @examples 247 | #' \dontrun{npm_outdated()} 248 | #' 249 | #' @return The output of the command 250 | #' as a `character` vector. 251 | #' 252 | #' @export 253 | npm_outdated <- function(){ 254 | system_2("outdated") 255 | } 256 | 257 | #' Update Packages 258 | #' 259 | #' Update NPM packages. 260 | #' 261 | #' @examples 262 | #' \dontrun{npm_update()} 263 | #' 264 | #' @return Invisibly returns the output of the command 265 | #' as a `character` vector. 266 | #' 267 | #' @export 268 | npm_update <- function(){ 269 | npm_run_process( 270 | "update", 271 | s = "Updating packages", 272 | d = "Updated packages", 273 | f = "Failed to update packages" 274 | ) 275 | } 276 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![R-CMD-check](https://github.com/JohnCoene/npm/workflows/R-CMD-check/badge.svg)](https://github.com/JohnCoene/npm/actions) 3 | 4 | 5 | # npm 6 | 7 | Interact with [npm](https://www.npmjs.com/) from the R console. 8 | 9 | ## Installation 10 | 11 | __Stable__ 12 | 13 | ``` r 14 | install.packages("npm") 15 | ``` 16 | 17 | __Development__ 18 | 19 | ``` r 20 | # install.packages("remotes") 21 | remotes::install_github("JohnCoene/npm") 22 | ``` 23 | 24 | ## Example 25 | 26 | ``` r 27 | library(npm) 28 | npm_install("browserify", scope = "global") 29 | 30 | npm_init() 31 | npm_install("jquerjqueryy") 32 | npm_run("--version") 33 | ``` 34 | 35 | Also see [yarn](https://github.com/JohnCoene/yarn). 36 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## R CMD check results 2 | 3 | 0 errors | 0 warnings | 1 note 4 | 5 | * This is a new release. 6 | 7 | > Please add \value to .Rd files regarding exported methods and explain 8 | > the functions results in the documentation. Please write about the 9 | > structure of the output (class) and also what the output means. (If a 10 | > function does not return a value, please document that too, e.g. 11 | > \value{No return value, called for side effects} or similar) 12 | > Missing Rd-tags: 13 | > npm_audit.Rd: \value 14 | > npm_init.Rd: \value 15 | > npm_install.Rd: \value 16 | > npm_outdated.Rd: \value 17 | > npm_path.Rd: \value 18 | > npm_update.Rd: \value 19 | > 20 | > Please fix and resubmit. 21 | 22 | All exported functions have `\value`. 23 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | install: check 2 | Rscript -e "devtools::install()" 3 | 4 | check: document 5 | Rscript -e "devtools::document()" 6 | 7 | document: 8 | Rscript -e "devtools::check()" 9 | -------------------------------------------------------------------------------- /man/does_exist.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/assertions.R 3 | \name{does_exist} 4 | \alias{does_exist} 5 | \title{Assertions} 6 | \usage{ 7 | does_exist(x) 8 | } 9 | \description{ 10 | Assertions 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/npm_audit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_audit} 4 | \alias{npm_audit} 5 | \title{NPM Audit Fix} 6 | \usage{ 7 | npm_audit(fix = FALSE) 8 | } 9 | \arguments{ 10 | \item{fix}{Whether to also fix issues.} 11 | } 12 | \value{ 13 | Invisibly returns the output of the command 14 | as a \code{character} vector. 15 | } 16 | \description{ 17 | Audit NPM packages and fix potential issues. 18 | } 19 | \examples{ 20 | \dontrun{npm_audit()} 21 | 22 | } 23 | -------------------------------------------------------------------------------- /man/npm_find.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_find} 4 | \alias{npm_find} 5 | \title{Find NPM} 6 | \usage{ 7 | npm_find() 8 | } 9 | \description{ 10 | Find path to NPM installation 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/npm_init.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_init} 4 | \alias{npm_init} 5 | \title{NPM Init} 6 | \usage{ 7 | npm_init() 8 | } 9 | \value{ 10 | Invisibly returns the output of the command 11 | as a \code{character} vector. 12 | } 13 | \description{ 14 | Initialise an NPM project. 15 | } 16 | \examples{ 17 | \dontrun{npm_init()} 18 | 19 | } 20 | -------------------------------------------------------------------------------- /man/npm_install.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_install} 4 | \alias{npm_install} 5 | \title{NPM Install} 6 | \usage{ 7 | npm_install(..., scope = c("dev", "prod", "exact", "global", "optional")) 8 | } 9 | \arguments{ 10 | \item{...}{Names of packages to install.} 11 | 12 | \item{scope}{Scope of the installation of the packages. 13 | This is ignored if no packages are passed to the three 14 | dots construct (\code{...}).} 15 | } 16 | \value{ 17 | Invisibly returns the output of the command 18 | as a \code{character} vector. 19 | } 20 | \description{ 21 | NPM Install 22 | } 23 | \examples{ 24 | \dontrun{npm_install("browserify", scope = "global")} 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/npm_outdated.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_outdated} 4 | \alias{npm_outdated} 5 | \title{Outdated Packages} 6 | \usage{ 7 | npm_outdated() 8 | } 9 | \value{ 10 | The output of the command 11 | as a \code{character} vector. 12 | } 13 | \description{ 14 | Get outdated NPM packages. 15 | } 16 | \examples{ 17 | \dontrun{npm_outdated()} 18 | 19 | } 20 | -------------------------------------------------------------------------------- /man/npm_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_path} 4 | \alias{npm_path} 5 | \alias{npm_path_set} 6 | \alias{npm_path_get} 7 | \title{Set Path to NPM Installation} 8 | \usage{ 9 | npm_path_set(path = Sys.getenv("NPM_PATH")) 10 | 11 | npm_path_get() 12 | } 13 | \arguments{ 14 | \item{path}{Path to NPM binary.} 15 | } 16 | \description{ 17 | Define the path to the NPM installation. By default, 18 | this should not be necessary, parcel will find the path 19 | by itself if NPM was installed correctly. 20 | } 21 | \section{Functions}{ 22 | \itemize{ 23 | \item \code{npm_path_get()}: Get NPM path 24 | 25 | }} 26 | -------------------------------------------------------------------------------- /man/npm_path_env_set.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_path_env_set} 4 | \alias{npm_path_env_set} 5 | \title{NPM Path Environment} 6 | \usage{ 7 | npm_path_env_set(path) 8 | } 9 | \description{ 10 | NPM Path Environment 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/npm_run.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_run} 4 | \alias{npm_run} 5 | \title{NPM Run} 6 | \usage{ 7 | npm_run(...) 8 | } 9 | \arguments{ 10 | \item{...}{arguments to pass to the \code{npm} command.} 11 | } 12 | \value{ 13 | Invisibly returns the output of the command. 14 | 15 | Invisibly returns the output of the command 16 | as a \code{character} vector. 17 | } 18 | \description{ 19 | NPM Run 20 | } 21 | -------------------------------------------------------------------------------- /man/npm_update.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{npm_update} 4 | \alias{npm_update} 5 | \title{Update Packages} 6 | \usage{ 7 | npm_update() 8 | } 9 | \value{ 10 | Invisibly returns the output of the command 11 | as a \code{character} vector. 12 | } 13 | \description{ 14 | Update NPM packages. 15 | } 16 | \examples{ 17 | \dontrun{npm_update()} 18 | 19 | } 20 | -------------------------------------------------------------------------------- /man/package_message.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{package_message} 4 | \alias{package_message} 5 | \title{Package Installation Messages} 6 | \usage{ 7 | package_message(...) 8 | } 9 | \description{ 10 | Creates messages for installation process. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/packages_flat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{packages_flat} 4 | \alias{packages_flat} 5 | \title{Flatten Packages} 6 | \usage{ 7 | packages_flat(...) 8 | } 9 | \description{ 10 | Flatten packages for creating the message. 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/system_2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/npm.R 3 | \name{system_2} 4 | \alias{system_2} 5 | \title{Wrapper on System Call} 6 | \usage{ 7 | system_2(..., stdout = TRUE, stderr = TRUE) 8 | } 9 | \description{ 10 | A soft wrapper on system call. 11 | } 12 | \keyword{internal} 13 | --------------------------------------------------------------------------------