A CLI build tool for userscript metadata block
npm install -D userscript-meta-cli
usage:
userscript-meta [--no-package] [--read=<file>...] [--update=<file>]
[--output=<file>] [--json]
options:
-n --no-package Don't extract data from package.json
-r --read Read metadata from files. Support json or any text file
containing userscript metadata block.
-u --update Update the metadata block in the file, instead of writing to
output.
-o --output Write output meta block to file. If not provided, writing to
stdout.
--json Output json format.
-v --version Print version number.
-h --help Print help screen.
Other fields like include
, exclude
, etc, could be set in userscript
field.
{
"userscript": {
"include": ["http://example.com/*", "http://example2.com/*"]
}
}
The metadata defined in userscript
would overwrite the fields in package.json root.
const metaObject = getMeta({
findPackage?: Boolean,
readFiles?: Array<String>
});
If findPackage
is true
then extract metadata from package.json
. Default: true
.
readFiles
is an array of filenames.
The stringify
method of userscript-meta.
The parse
method of userscript-meta.
0.4.2 (Aug 5, 2018)
0.4.1 (Aug 5, 2018)
files
in package.json.0.4.0 (Aug 5, 2018)
getMeta
API.node>=7
.0.3.0 (Mar 16, 2018)
@include *
when there is no include/match rule is found.package.json
. Now the tool would read package.json
file from the parent/ancestor folder.0.2.0 (Jul 29, 2017)
supportURL
from repository
.--update
help screen.--update
.0.1.0 (Mar 19, 2017)