https://github.com/netlogix/netlogix.eel.javascript
Neos Eel Helper to embed inline JavaScript
https://github.com/netlogix/netlogix.eel.javascript
Last synced: about 2 months ago
JSON representation
Neos Eel Helper to embed inline JavaScript
- Host: GitHub
- URL: https://github.com/netlogix/netlogix.eel.javascript
- Owner: netlogix
- License: mit
- Created: 2024-07-15T09:39:36.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-02-21T12:02:31.000Z (3 months ago)
- Last Synced: 2025-03-22T00:35:44.283Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netlogix.Eel.JavaScript
Neos Eel Helper to embed inline JavaScript from files.## Installation
```bash
composer require netlogix/eel-javascript
```## Usage
You can use the JavaScriptHelper in your Fusion files like this:### Scripts without Variables
To include scripts that don't require external variables, you can use the `embed` method.```
script = ${Netlogix.JavaScript.embed('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js')}
```### Scripts with Variables
To include scripts that require external variables, you can use the `embedWithVariables` method.```
scriptWithVars = ${Netlogix.JavaScript.embedWithVariables('resource://Netlogix.Eel.JavaScript/Private/ScriptWithVars.js', {'someVariableName': 'someValue'})}
```This will prefix the included javascript file with the variables passed to the method:
```javascript
var someVariable= 'someValue';
/// ... your script ScriptWithVars.js
```