Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7104476
are-plugins-avaliable.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
746 B
Referenced Files
None
Subscribers
None
are-plugins-avaliable.js
View Options
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
function
arePluginsAvaliable
(
plugins_path
)
{
if
(
plugins_path
)
{
console
.
log
(
'Plugin path provided. Checking the file...'
.
yellow
);
const
relative_plugins_path
=
path
.
relative
(
plugins_path
,
'/'
)
+
plugins_path
;
try
{
fs
.
accessSync
(
relative_plugins_path
,
fs
.
constants
.
F_OK
);
require
(
path
.
relative
(
plugins_path
,
'/'
)
+
plugins_path
);
console
.
log
(
'File succesfully found, proceeding...'
.
green
);
return
true
;
}
catch
(
error
)
{
console
.
log
(
'An error on import attempt occurred, aborting...'
.
red
);
console
.
log
(
error
);
return
false
;
}
}
console
.
log
(
'Plugins not found, omitting including process...'
);
return
false
;
}
module
.
exports
=
arePluginsAvaliable
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 03:05 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
795860
Default Alt Text
are-plugins-avaliable.js (746 B)
Attached To
Mode
rSEALPAGE Sealpage
Attached
Detach File
Event Timeline
Log In to Comment