From c49cc2b539b463383cc182e0e831fb7d9cd739e5 Mon Sep 17 00:00:00 2001 From: Tomas Jansson Date: Mon, 2 Nov 2015 06:34:45 -0800 Subject: [PATCH] added sample to comment for npmhelper --- src/app/FakeLib/NpmHelper.fs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/app/FakeLib/NpmHelper.fs b/src/app/FakeLib/NpmHelper.fs index b953ff0a1f3..01bc2c4828c 100644 --- a/src/app/FakeLib/NpmHelper.fs +++ b/src/app/FakeLib/NpmHelper.fs @@ -1,5 +1,5 @@ /// Contains function to run npm tasks -module NpmHelper +module Fake.NpmHelper open Fake open System open System.IO @@ -58,9 +58,28 @@ let run npmParams = info.Arguments <- arguments) npmParams.Timeout if not ok then failwith (sprintf "'npm %s' task failed" arguments) -/// Runs npm with the given modification function +/// 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 +/// +/// 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/" +/// }) +/// ) let Npm setParams = defaultNpmParams |> setParams |> run