Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892025
init_node.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
922 B
Referenced Files
None
Subscribers
None
init_node.js
View Options
'use strict'
;
/**
* Alternative Javelin init file for Node.js.
*
* @javelin-installs JX.enableDispatch
* @javelin-installs JX.onload
* @javelin-installs JX.flushHoldingQueue
* @javelin-installs JX.require
*
* @javelin
*/
var
JX
=
{};
var
fs
=
require
(
'fs'
);
var
vm
=
require
(
'vm'
);
var
pathModule
=
require
(
'path'
);
var
noop
=
function
()
{};
JX
.
enableDispatch
=
noop
;
JX
.
flushHoldingQueue
=
noop
;
JX
.
onload
=
function
(
func
)
{
func
();
};
JX
.
require
=
function
(
thing
)
{
var
path
=
__dirname
+
'/../'
+
thing
+
'.js'
;
var
content
=
fs
.
readFileSync
(
path
);
var
dir
=
pathModule
.
dirname
(
path
);
var
k
;
var
sandbox
=
{};
for
(
k
in
global
)
{
sandbox
[
k
]
=
global
[
k
];
}
var
extra
=
{
JX
:
this
,
__DEV__
:
0
,
window
:
{},
__dirname
:
dir
};
for
(
k
in
extra
)
{
sandbox
[
k
]
=
extra
[
k
];
}
vm
.
createScript
(
content
,
path
)
.
runInNewContext
(
sandbox
);
};
exports
.
JX
=
JX
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 16:07 (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126316
Default Alt Text
init_node.js (922 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment