node-red-contrib-simplejs 0.0.4

parseFloat(), parseInt(), String(), isNaN(), isFinite() in a node

npm install node-red-contrib-simplejs

node-red-contrib-simplejs = This node implements some global JavaScript functions so you don't need to use a function-node everytime you need a simple conversion like parseFloat(), parseInt(), etc.

Functions -

The functions are documented here: http://www.w3schools.com/jsref/jsref_obj_global.asp

String() uses toString() if present on msg.<property>.

Usage - Simply drag the node to your flow and select a desired function in the dropdown and tweak the wanted object property. If you want, define a name. Otherwise the function name with the desired property is shown.

The node only works on the msg-object!

Keep in mind, that if a function can not return anything or the function evaluates to false, the node will return null and your flow will not move on.

Contributing -

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Credits - Patrik Mayer, 2017

License - MIT

Node Info

Version: 0.0.4
Updated 8 months, 3 weeks ago
License: MIT

Downloads

4 in the last day
15 in the last week
63 in the last month

Nodes

  • simplejs

Keywords

  • node-red
  • javascript

Maintainers

  • pmayer