1.0.3 • Published 2 years 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);globalOptswill merged withlocalOptswhen run withlocalOptshigh 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.
.jsreturn value..ejsreturn 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
3 years ago
1.1.0-beta.1
3 years ago
1.1.0-beta.0
3 years ago
1.1.0-beta.3
2 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.3
3 years ago
1.0.0
3 years ago