项目作者: TomONeill

项目描述 :
Prepend your userscripts with the power of JSON
高级语言: JavaScript
项目地址: git://github.com/TomONeill/gulp-monkeyscript.git
创建时间: 2017-03-04T11:11:46Z
项目社区:https://github.com/TomONeill/gulp-monkeyscript

开源协议:MIT License

下载


Install

  1. $ 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:

  1. "$schema": "./node_modules/gulp-monkeyscript/schema.json",

Add the key-value pairs to your needs. See Showcase for an example.

gulpfile.js:

  1. var ms = require('gulp-monkeyscript');
  2. var msProject = ms.createProject("monkeyscript.json");
  3. gulp.src("src/**/*.js")
  4. .pipe(concat("script.user.js"))
  5. .pipe(msProject())
  6. .pipe(gulp.dest("dist/"));

Showcase

  1. {
  2. "$schema": "./node_modules/gulp-monkeyscript/schema.json",
  3. "name": "My Awesome Userscript!",
  4. "version": "1.0.0",
  5. "author": "Tom",
  6. "description": "This userscript adds new functionality!",
  7. "match": [
  8. "http://www.website.com/page1/",
  9. "http://www.website-alter.com/*"
  10. ],
  11. "runAt": "document-start",
  12. "useStrict": true
  13. }

Becomes:

  1. // ==UserScript==
  2. // @name My Awesome Userscript!
  3. // @version 1.0.0
  4. // @author Tom
  5. // @description This userscript adds new functionality!
  6. // @match http://www.website.com/page1/
  7. // @match http://www.website-alter.com/*
  8. // @run-at document-start
  9. // ==/UserScript==
  10. 'use strict';
  11. <other source>

Dependencies

License

MIT © 2017 Tom O’Neill