From 02194da65886e9d8d2ce07667b26ef9833aa94c9 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 28 May 2019 19:09:15 +0300 Subject: [PATCH] docs(cookbook) npm script --- User-Menu-Cookbook.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/User-Menu-Cookbook.md b/User-Menu-Cookbook.md index 14f961e..9be4cbf 100644 --- a/User-Menu-Cookbook.md +++ b/User-Menu-Cookbook.md @@ -160,4 +160,30 @@ function compare(a, b) { return result; } +``` + +## Execute Npm Script + +```js +module.exports = { + 'D - Build Dev': async ({CloudCmd}) => { + await CloudCmd.TerminalRun.show({ + command: 'npm run build:client:dev', + autoClose: false, + // custom close message + closeMessage: 'Press any button to close Terminal', + }); + + CloudCmd.refresh(); + }, + 'P - Build Prod': async ({CloudCmd}) => { + await CloudCmd.TerminalRun.show({ + command: 'npm run build:client', + // close window when done + autoClose: true, + }); + + CloudCmd.refresh(); + }, +} ``` \ No newline at end of file