Skip to content

TomONeill/gulp-monkeyscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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

{
    "$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:

// ==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';

<other source>

Dependencies

License

MIT © 2017 Tom O'Neill

Releases

No releases published

Packages

No packages published