{"id":15284553,"url":"https://github.com/eight04/userscript-meta-cli","last_synced_at":"2026-01-02T15:19:45.017Z","repository":{"id":57388761,"uuid":"85602968","full_name":"eight04/userscript-meta-cli","owner":"eight04","description":"A CLI build tool for userscript metadata block","archived":false,"fork":false,"pushed_at":"2019-06-05T13:35:40.000Z","size":88,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-01T14:58:13.377Z","etag":null,"topics":["cli","nodejs","userscript","userscript-meta","userscript-metadata"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eight04.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-20T16:56:28.000Z","updated_at":"2022-11-02T16:48:20.000Z","dependencies_parsed_at":"2022-09-19T01:40:32.027Z","dependency_job_id":null,"html_url":"https://github.com/eight04/userscript-meta-cli","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2Fuserscript-meta-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2Fuserscript-meta-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2Fuserscript-meta-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eight04%2Fuserscript-meta-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eight04","download_url":"https://codeload.github.com/eight04/userscript-meta-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219847211,"owners_count":16556407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","nodejs","userscript","userscript-meta","userscript-metadata"],"created_at":"2024-09-30T14:58:11.633Z","updated_at":"2026-01-02T15:19:44.986Z","avatar_url":"https://github.com/eight04.png","language":"JavaScript","readme":"userscript-meta-cli\n===================\n\n[![Build Status](https://travis-ci.org/eight04/userscript-meta-cli.svg?branch=master)](https://travis-ci.org/eight04/userscript-meta-cli)\n[![codecov](https://codecov.io/gh/eight04/userscript-meta-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/eight04/userscript-meta-cli)\n[![install size](https://packagephobia.now.sh/badge?p=userscript-meta-cli)](https://packagephobia.now.sh/result?p=userscript-meta-cli)\n\nA CLI build tool for userscript metadata block\n\nFeatures\n--------\n* Build metadata block with information inside package.json.\n* Merge multiple metadata files.\n* Update metablock inside userscripts.\n\nInstall\n-------\n```\nnpm install -D userscript-meta-cli\n```\n\nUsage\n-----\n```\nusage:\n  userscript-meta [--no-package] [--read=\u003cfile\u003e...] [--update=\u003cfile\u003e]\n                  [--output=\u003cfile\u003e] [--json]\n  \noptions:\n  -n --no-package Don't extract data from package.json\n  \n  -r --read       Read metadata from files. Support json or any text file\n                  containing userscript metadata block.\n\t\t\t\t  \n  -u --update     Update the metadata block in the file, instead of writing to\n                  output.\n\t\t\t\t  \n  -o --output     Write output meta block to file. If not provided, writing to\n                  stdout.\n\t\t\t\t  \n  --json          Output json format.\n\t\t\t\t  \n  -v --version    Print version number.\n  -h --help       Print help screen.\n```\n\nReconized fields in package.json\n--------------------------------\n* name\n* title - an alias of name\n* version\n* description\n* homepage - homepageURL\n* bugs - supportURL\n* license\n* author\n* contributors - contributor\n* repository - if homepage is missing and repository is provided, it will try to guess homepageURL according to this field.\n* engines - compatible\n\nOther fields like `include`, `exclude`, etc, could be set in `userscript` field.\n```json\n{\n\t\"userscript\": {\n\t\t\"include\": [\"http://example.com/*\", \"http://example2.com/*\"]\n\t}\n}\n```\nThe metadata defined in `userscript` would overwrite the fields in package.json root.\n\nAPI\n----\n\n### getMeta\n\n```js\nconst metaObject = getMeta({\n  findPackage?: Boolean,\n  readFiles?: Array\u003cString\u003e\n});\n```\n\nIf `findPackage` is `true` then extract metadata from `package.json`. Default: `true`.\n\n`readFiles` is an array of filenames.\n\n### stringify\n\nThe `stringify` method of [userscript-meta](https://www.npmjs.com/package/userscript-meta).\n\n### parse\n\nThe `parse` method of [userscript-meta](https://www.npmjs.com/package/userscript-meta).\n\nTodos\n-----\n* Integrate [browserslist](https://www.npmjs.com/package/browserslist) with compatible field.\n\nChangelog\n---------\n\n* 0.4.2 (Aug 5, 2018)\n\n  - Fix: missing cli.\n\n* 0.4.1 (Aug 5, 2018)\n\n  - Fix: missing `files` in package.json.\n\n* 0.4.0 (Aug 5, 2018)\n\n  - Add: `getMeta` API.\n  - Add: Node dependency `node\u003e=7`.\n\n* 0.3.0 (Mar 16, 2018)\n\n\t- Add: `@include *` when there is no include/match rule is found.\n\t- Add: a better way to find `package.json`. Now the tool would read `package.json` file from the parent/ancestor folder.\n  \n* 0.2.0 (Jul 29, 2017)\n\n\t- Add: generate `supportURL` from `repository`.\n\t- Add: warning message to `--update` help screen.\n\t- Fix: new line issue with `--update`.\n\t- Fix: doesn't work under linux due to CRLF issue.\n  \n* 0.1.0 (Mar 19, 2017)\n\n\t- First release.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feight04%2Fuserscript-meta-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feight04%2Fuserscript-meta-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feight04%2Fuserscript-meta-cli/lists"}