Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wiwichips/winj


https://github.com/wiwichips/winj

Last synced: 2 days ago
JSON representation

Awesome Lists containing this project

README

        

# winj
Will Inject
* this is used for embedding file binaries into functions specifically for dcp apps
* injects a file into a workfunction as a string of bytes
* very hacky solution I use for personal projects

Example:
```javascript
const winj = require('winj);

function workFunction () {
// ...
const bin = WINJ_EMBED_FILE_AS_BIN('./yourFileOnYourMachine');
// ...
}

const workFunctionAsAString = await winj.embedFileAsBinary(workFunction);

// ...
const job = compute.for(data, workFuntionAsAString);
const results = job.exec();
```

TODO
* make this into a more proper node module
* store the binary somewhere in case multiple calls are made to it