Giter Club home page Giter Club logo

node-red-contrib-unsafe-function's People

Contributors

mikes7 avatar natcl avatar ozomer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

node-red-contrib-unsafe-function's Issues

Feature proposal: external file

Hello !
Would you be interested in a PR that would add external file support ? (being able to load a js file from disk instead of executing the code in the node's editor window) If so would you be willing to discuss implementation details ?

Thanks !

node-red-contrib-unsafe-function enhancement

Hi @ozomer , I was inspired by your project and I started adding new features. What I have done so far:

UI

  • Updated the code to use the new function tabs editor (node-red > 1.0)
  • Added the ability to install and uninstall external NPM modules
  • Added the ability to create custom JavaScript modules (stored under the component directory)

TABS
The new node interface is composed as follows:

  • Function
  • Packages
  • Modules

image

FUNCTION TAB
The function tab works the same way as the original one, with the ability to format the code (using js-beautify).

image

PACKAGES TAB
With this tab you can install and uninstall NPM modules.
image

MODULES TAB
This tab lists all the JavaScript modules created by the user. You can create, edit, format code, and delete a module directly from the web interface.

main
image

editor
image
Toolbar options: back, format code, save module, delete module

What do you think about it?

'Require' imports from parent, not "config"

This may be "as designed" but it was a bit confusing. And I run Node-red in a bit different manner, so this could be my fault.

I run my node-red admin tool not as a global install but from a directory where I control the arguments to the config folder.

example

mkdir ~/NodeRed yarn init -y . yarn add node-red yarn add node-red-admin mkdir config
I run node red once, stop it set the password, and restart.
yarn node-red -u config -v

~/NodeRed <- parent project that hosts all my node-red junk

~/NodeRed/config <- node red flow project as edited by node-red

I i go into the NodeRed/config directory and install a package - (I installed https://www.npmjs.com/package/rss-node-mongo)

and then created an unsafe function to import it.

I could not import the module from within that unsafe function

but when I added it to the ~/NodeRed project it worked fine.

I've never deployed my node-red projects as they are all for personal use or home projects or whatever and I prefer to keep the admin tool running for my needs. BUT ... I think unsafe function would break in this context, not being able to find the module, and would need the module installed as a global.

Thoughts?

env.get doesn't work

Under node-red 0.20 env.get doesn't seem to work, not sure if it's supported yet though ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.