Indel AG's TransferLua is a dynamic library (.dll
, .so
) with a C-API that allows downloading Lua scripts to it's real-time contolling systems. This project is a wrapper around that C-API for Node.
I took the "lean approach": The basic functionality is in place, but less commonly used features may not yet be. Extending it should be farely easy and everyone's invited to do so.
The main motivation for this project was to have Node wrapper suitable to be used by VSCode extensions.
npm i @softwarenatives/transferlua
Assuming there is a helloworld.js
in the current working dir, create something like this:
const transferLua = require("@softwarenatives/transferlua");
const indelTargetName = 'IndelTargetName'; // E.g. "Net251"
const luaStateName = 'Machine';
const options = transferLua.combineOptions(
transferLua.OPTION_EXECUTE);
const transfer = new transferLua.TransferLua(indelTargetName, { force: true });
transfer.sendFile('./helloworld.lua', luaStateName, { options: options });
transfer.close()
This wrapper should support all platforms on which Indel's library is available. At the time of this writing, these are
- Windows
- Linux
As mentioned, only the "thus far required" functionality is in place. Namely, the following is missing:
- "Error writer" callback not yet implemented (thus, the ability to get 'good error reporting' not given yet)
- Convertion from error codes (uint64) into human readable text is yet missing
- Test coverage for various options of
sendFile
andsendChunk
not yet given (and also not manually tested yet) - TS types could be improved for the various optional arguments
This module is so small that I felt to write it in JavaScript rather than TypeScript, although I like the latter more. I feel like the overhead is smaller for JS, since no transpiling, etc. is required.
Note that if someone would convert it to TS, such a contribution would be welcome.