nv-facutil-rrequire2
v1.0.2
Published
nv-facutil-rrequire2 ======================= - only for nodejs, require from String|Url |Buffer | Blob | Stream | ArrayBuffer | TypedArray - replace nv-facutil-rrequire
Downloads
28
Readme
nv-facutil-rrequire2
- only for nodejs, require from String|Url |Buffer | Blob | Stream | ArrayBuffer | TypedArray
- replace nv-facutil-rrequire
install
- npm install nv-facutil-rrequire2
splitted
usage
const { r, un, urlrr} = require("nv-facutil-rrequire2");
// r : require
// un : un-require
// urlrr: re-require ,only work for url
example
0
> var m = await r("function tst(){}; module.exports = {tst}", "my-mod")
> m
{ tst: [Function: tst] }
> m["mod::info"]()
{
mod: Module {
id: 'str://9c90e5677cc780279b2f7d7a31ffdf3c/my-mod',
path: 'str://9c90e5677cc780279b2f7d7a31ffdf3c',
exports: { tst: [Function: tst] },
filename: 'str://9c90e5677cc780279b2f7d7a31ffdf3c/my-mod',
loaded: false,
children: [],
paths: [
...
]
},
pmod: Module {
id: '/mnt/sda3/NV6-/nvfac/pkgs/ARCHIEVED/require/nv-facutil-rrequire2/str.js',
path: '/mnt/sda3/NV6-/nvfac/pkgs/ARCHIEVED/require/nv-facutil-rrequire2',
exports: [Function (anonymous)],
filename: '/mnt/sda3/NV6-/nvfac/pkgs/ARCHIEVED/require/nv-facutil-rrequire2/str.js',
loaded: true,
children: [ [Module], [Module], [Module] ],
paths: [
...
]
},
id: 'str://9c90e5677cc780279b2f7d7a31ffdf3c/my-mod',
paramsd: undefined,
method: undefined
}
>
0_0
0_1
1
1_0
1_1
METHODS
APIS
LICENSE
- ISC