Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7859931
module-info.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
744 B
Referenced Files
None
Subscribers
None
module-info.js
View Options
var
fs
=
require
(
"fs"
);
function
ModuleInfo
(
path
){
this
.
readInfo
(
path
);
}
ModuleInfo
.
prototype
=
new
function
(){
var
required_fields
=
[
"prometheus-module-id"
];
var
field_map
=
{
"prometheus-module-id"
:
"id"
,
"prometheus-required-chips"
:
"requires"
,
"prometheus-defined-chips"
:
"defines"
}
this
.
readInfo
=
function
(
path
){
var
json_string
=
fs
.
readFileSync
(
path
+
"/package.json"
);
var
package_info
=
JSON
.
parse
(
json_string
);
for
(
var
i
in
required_fields
){
if
(
!
(
required_fields
[
i
]
in
package_info
)){
throw
new
Error
(
"Missing field `"
+
required_fields
[
i
]
+
"` in "
+
path
);
}
}
for
(
var
field_name
in
field_map
){
this
[
field_map
[
field_name
]]
=
package_info
[
field_name
]
||
[];
}
}
}
module
.
exports
=
ModuleInfo
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 13, 17:10 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
868467
Default Alt Text
module-info.js (744 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment