1.0.3 • Published 12 months ago
@rugo-vn/fx v1.0.3
Rugo Fx
Rugo Fx for running code.
Usage
const fx = new Fx(globalOpts);
const res = await fx.run('filePath', localOpts);
globalOpts
will merged withlocalOpts
when run withlocalOpts
high priority.
const opts = {
files: {
'/path/to/file/a': 'file_content',
'/path/to/file/b': 'file_content',
'/path/to/file/c': 'file_content',
},
locals: {
'name': /* module that you want to bind */
}
};
We both support .js
and .ejs
file, and determine these file in the path.
.js
return value..ejs
return entire file as string after render.
You can execute another file by await include('filePath', locals)
.
Service
We can also fx with service.
const res = await service.call(
'run',
{
entry: 'filePath',
...otherFxOpts,
},
opts
);
We provide call
methods that you want to communicate other action's service.
Settings
const settings = {
allows: [
/* white list of action to want fx context to execute */
],
};
License
MIT.
1.1.0-beta.2
1 year ago
1.1.0-beta.1
1 year ago
1.1.0-beta.0
1 year ago
1.1.0-beta.3
12 months ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.3
1 year ago
1.0.0
1 year ago