https://github.com/software-natives-oss/transferlua
Node.js module. Wrapper for Indel's LuaTransfer C-Library
https://github.com/software-natives-oss/transferlua
Last synced: 18 days ago
JSON representation
Node.js module. Wrapper for Indel's LuaTransfer C-Library
- Host: GitHub
- URL: https://github.com/software-natives-oss/transferlua
- Owner: Software-Natives-OSS
- License: mit
- Created: 2020-11-07T07:42:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T19:04:29.000Z (over 5 years ago)
- Last Synced: 2025-02-22T23:17:53.315Z (over 1 year ago)
- Language: JavaScript
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node wrapper for Indel's TransferLua C-Library
[Indel AG's](https://indel.ch) 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.
## State
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.
## Motivation
The main motivation for this project was to have Node wrapper suitable to be used by VSCode extensions.
## Installation
```sh
npm i @softwarenatives/transferlua
```
## Basic usage
Assuming there is a `helloworld.js` in the current working dir, create something like this:
```js
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()
```
## Supported platforms
This wrapper should support all platforms on which Indel's library is available. At the time of this writing, these are
- Windows
- Linux
## TODO
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` and `sendChunk` not yet given (and also not manually tested yet)
- TS types could be improved for the various optional arguments
## Why not in TS?
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.