
Search found 37 matches
- Tue Sep 10, 2024 2:05 pm
- Forum: Node.js scripting
- Topic: right way to import npm-module
- Replies: 2
- Views: 14013
Re: right way to import npm-module
Hi, yes I use Visual Studio Code ... 95% of my Scripts are now TypeScript ... and I have a lot. I don't know the Version of PowerSwitch (there is somewhere a Webinar) we should use require - now back to import. Sometimes works require sometimes import 

- Wed Aug 28, 2024 3:33 pm
- Forum: Node.js scripting
- Topic: right way to import npm-module
- Replies: 2
- Views: 14013
right way to import npm-module
Hi, what is the standard way to use an mpm module?
PowerSwitch 2024 Spring
npm install fs-extra
old script works with: import * as fs from "fs-extra";
newly created script won't import it with this command.
Greetings
PowerSwitch 2024 Spring
npm install fs-extra
old script works with: import * as fs from "fs-extra";
newly created script won't import it with this command.
Greetings
- Mon Jul 01, 2024 1:47 pm
- Forum: Node.js scripting
- Topic: Error in Node.js Scripting within Switch
- Replies: 4
- Views: 20282
Re: Error in Node.js Scripting within Switch
Hi, in my old Script I worked whit import - now it worked whit require:
If someone have the same Problem - try require.
Code: Select all
const exiftool = require('node-exiftool');
- Mon Jul 01, 2024 11:13 am
- Forum: Node.js scripting
- Topic: Error in Node.js Scripting within Switch
- Replies: 4
- Views: 20282
Re: Error in Node.js Scripting within Switch
normal is that not - I use node-exiftool ... in a older Script Version 2.3.0 is working - now i create a script, npm i node-exiftool ... not working - same version 2.3.0 Error: Failed to transpile the code: TypeScript failed with exit code 2 Error: TypeScript standard output: main.ts(1,27): error TS...
- Fri Dec 01, 2023 9:13 am
- Forum: Node.js scripting
- Topic: REST API GET/POST calls within Switch workflow via "Script Element"
- Replies: 2
- Views: 23347
Re: REST API GET/POST calls within Switch workflow via "Script Element"
Hi,
so really I don't know what you mean, this?
https://www.enfocus.com/en/learn/switch#scripting
I use in very much Scripts axios for API-Calls
Michael
so really I don't know what you mean, this?
https://www.enfocus.com/en/learn/switch#scripting
I use in very much Scripts axios for API-Calls
Michael
- Wed Oct 25, 2023 10:45 am
- Forum: Node.js scripting
- Topic: Update Values in xml files
- Replies: 5
- Views: 16643
Re: Update Values in xml files
Hi, whitout npm install path und fs-extra no chance
- Fri Sep 08, 2023 12:54 pm
- Forum: Node.js scripting
- Topic: Logging of variable
- Replies: 6
- Views: 19563
Re: Logging of variable
Hi
Code: Select all
await job.log(LogLevel.Info, "Url to encode: " + URLtoEncode);
- Wed Jun 07, 2023 2:57 pm
- Forum: Node.js scripting
- Topic: Database Values as NodeJS Parameters
- Replies: 7
- Views: 33027
Re: Database Values as NodeJS Parameters
Hi, [Database.Text:SQL="SELECT #columnName FROM #tableName WHERE #columnValue = '[Job.PrivateData:Key="adID"]'",Connection="FileMaker-Database"] should it not be: [Database.Text:SQL="SELECT " + columnName + " FROM " + tableName + " WHERE " ...
- Wed Oct 05, 2022 8:34 pm
- Forum: Node.js scripting
- Topic: error importing axios in typescript script folder
- Replies: 6
- Views: 11795
Re: error importing axios in typescript script folder
yes freddy, i have the same errors with other modules - on one mac no problem, other mac problem
- Fri Sep 30, 2022 3:40 pm
- Forum: Node.js scripting
- Topic: catch (err) -> err.message
- Replies: 3
- Views: 21810
catch (err) -> err.message
Hi, i have this code from documentation: try { dosomething } catch (err) { job.fail('PDF error: %1'); //job.fail('PDF error: %1', [err]); //grmpf err unknown } why do I get this error, when I use the line whit [err]? michael@macpro seitenmelder % SwitchScriptTool --transpile . Error: Failed to trans...
- Fri Sep 30, 2022 3:29 pm
- Forum: Node.js scripting
- Topic: node.js debugger setup
- Replies: 6
- Views: 26848
- Wed Aug 25, 2021 3:06 pm
- Forum: Node.js scripting
- Topic: Curl Switch Script Example
- Replies: 2
- Views: 7547
- Thu May 27, 2021 2:43 pm
- Forum: Node.js scripting
- Topic: Stats.NumberOfPages
- Replies: 8
- Views: 20593
Re: Stats.NumberOfPages
Hi Laurentd,
today ist May 27th, System requirements is uptodate, but I can't download 2021 spring. I would like to update my Switch-Dev-Version
today ist May 27th, System requirements is uptodate, but I can't download 2021 spring. I would like to update my Switch-Dev-Version

- Mon May 17, 2021 3:38 pm
- Forum: Node.js scripting
- Topic: Stats.NumberOfPages
- Replies: 8
- Views: 20593
Stats.NumberOfPages
Hi,
how do I get the Switch-Stats-Values in NodeJS?
Greeting
Michael
how do I get the Switch-Stats-Values in NodeJS?
Greeting
Michael
- Wed Feb 24, 2021 12:09 pm
- Forum: Node.js scripting
- Topic: switchScriptTool --pack
- Replies: 6
- Views: 12214
Re: switchScriptTool --pack
remember - if you are using a Icon in that Script - the pack would only work, when the icon-name is the same as the script