https://github.com/tomoneill/gulp-monkeyscript
Prepend your userscripts with the power of JSON
https://github.com/tomoneill/gulp-monkeyscript
greasemonkey gulp-plugin monkeyscript tampermonkey userscript
Last synced: 9 months ago
JSON representation
Prepend your userscripts with the power of JSON
- Host: GitHub
- URL: https://github.com/tomoneill/gulp-monkeyscript
- Owner: TomONeill
- License: mit
- Created: 2017-03-04T11:11:46.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T12:28:43.000Z (almost 9 years ago)
- Last Synced: 2025-04-14T21:13:54.581Z (9 months ago)
- Topics: greasemonkey, gulp-plugin, monkeyscript, tampermonkey, userscript
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
```
$ npm install gulp-monkeyscript --save-dev
```
## Usage
Add `monkeyscript.json` to the root of your project and add the following line to get Intellisense working:
```
"$schema": "./node_modules/gulp-monkeyscript/schema.json",
```
Add the key-value pairs to your needs. See Showcase for an example.
`gulpfile.js`:
```js
var ms = require('gulp-monkeyscript');
var msProject = ms.createProject("monkeyscript.json");
gulp.src("src/**/*.js")
.pipe(concat("script.user.js"))
.pipe(msProject())
.pipe(gulp.dest("dist/"));
```
## Showcase
```json
{
"$schema": "./node_modules/gulp-monkeyscript/schema.json",
"name": "My Awesome Userscript!",
"version": "1.0.0",
"author": "Tom",
"description": "This userscript adds new functionality!",
"match": [
"http://www.website.com/page1/",
"http://www.website-alter.com/*"
],
"runAt": "document-start",
"useStrict": true
}
```
Becomes:
```js
// ==UserScript==
// @name My Awesome Userscript!
// @version 1.0.0
// @author Tom
// @description This userscript adds new functionality!
// @match http://www.website.com/page1/
// @match http://www.website-alter.com/*
// @run-at document-start
// ==/UserScript==
'use strict';
```
## Dependencies
- readable-stream
- streamqueue
## License
MIT © 2017 Tom O'Neill