Extract the part of the metablock that's needed for @updateURL requests
- Source:
Methods
-
<static> fromFile(file, callback [, incUpdateURL] [, incDownloadURL])
-
Asynchronously extract the update metablock from the given file
Parameters:
Name Type Argument Default Description filestring Path to the file
callbackUserscriptUtilsErrStringCallback The callback function
incUpdateURLboolean <optional>
false Whether to include the @updateURL tag
incDownloadURLboolean <optional>
false Whether to include the @downloadURL tag
- Source:
-
<static> fromFileSync(file [, incUpdateURL] [, incDownloadURL])
-
Synchronously extract the update metablock from the given file
Parameters:
Name Type Argument Default Description filestring Path to the file
incUpdateURLboolean <optional>
false Whether to include the @updateURL tag
incDownloadURLboolean <optional>
false Whether to include the @downloadURL tag
- Source:
Throws:
-
if the metadata block is not found
- Type
- Error
Returns:
The reduced metadata block suitable for .meta.js files
- Type
- string
-
<static> fromString(str, callback [, incUpdateURL] [, incDownloadURL])
-
Asynchronously extract the update metablock from the given string
Parameters:
Name Type Argument Default Description strstring The string to extract from
callbackUserscriptUtilsErrStringCallback The callback function
incUpdateURLboolean <optional>
false Whether to include the @updateURL tag
incDownloadURLboolean <optional>
false Whether to include the @downloadURL tag
- Source:
-
<static> fromStringSync(str [, incUpdateURL] [, incDownloadURL])
-
Synchronously extract the update metablock from the given string
Parameters:
Name Type Argument Default Description strstring The string to extract from
incUpdateURLboolean <optional>
false Whether to include the @updateURL tag
incDownloadURLboolean <optional>
false Whether to include the @downloadURL tag
- Source:
Throws:
-
if the metadata block is not found
- Type
- Error
Returns:
The reduced metadata block suitable for .meta.js files
- Type
- string