archimatetool / archi-scripting-plugin

jArchi - Scripting for Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
118 stars 33 forks source link

Support Node Modules #126

Closed Phillipus closed 5 months ago

Phillipus commented 5 months ago

This is to track the work of @jbsarrodie to implement node modules.

Dev branch: dev-jb.

Phillipus commented 5 months ago

Simple test case:

  1. In your jArchi script folder create a file test_module.ajs containing this:
    const speaker = require("helloworld");
    speaker.sayHelloWorld();
  2. In your jArchi script folder create a sub-folder named node_modules
  3. In the node_modules folder create a sub-folder named helloworld
  4. In the helloworld folder create a file index.js containing this:
    exports.sayHelloWorld = function() {
    window.alert("Hello World!");
    }
  5. Run the test_module.ajs script

Files attached here: script.zip

Phillipus commented 5 months ago

Committed to master and added a wiki entry.