userscript-meta
Parse and stringify Userscript metadata.
Installation
npm install userscript-meta --save
API
parse(string)
parse userscript metadata to an object.
const userscript = userscript
equals to
name: 'Userscript name' version: '1.0' // Field which has multiple value will parsed to an array match: 'http://www.exmaple.com/*' 'http://www.exmaple.org/*'
stringify(object)
const userscript = userscript
equals to
// ==UserScript==// @name Userscript name// @version 1.0// @match http://www.example.com/*// @match http://www.example.org/*// ==/UserScript==
license
MIT