Note: This API documentation is for FAKE version 4. The migration API documentation can be found here. The API documentation for the new fake 5 modules can be found here

NpmHelper

Contains function to run npm tasks

Nested types and modules

TypeDescription
InstallArgs

Arguments for the Npm install command

NpmCommand

The list of supported Npm commands.

NpmParams

The Npm parameter type

Functions and values

Function or valueDescription
defaultNpmParams
Signature: NpmParams

Npm default parameters

Npm(setParams)
Signature: setParams:(NpmParams -> NpmParams) -> unit

Runs npm with the given modification function. Make sure to have npm installed, you can install npm with nuget or a regular install. To change which Npm executable to use you can set the NpmFilePath parameter with the setParams function.

Parameters

  • setParams - Function used to overwrite the Npm default parameters.

Sample

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
   Target "Web" (fun _ ->
       Npm (fun p ->
              { p with
                  Command = Install Standard
                  WorkingDirectory = "./src/FAKESimple.Web/"
              })

       Npm (fun p ->
              { p with
                  Command = (Run "build")
                  WorkingDirectory = "./src/FAKESimple.Web/"
              })
   )
run(npmParams)
Signature: npmParams:NpmParams -> unit

Runs the given process and returns the process result.