Nightly Procrastination Machine

    gulp-userscript
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.0 • Public • Published

    gulp-userscript

    Build Status codecov npm

    Generate Userscript metadata.

    Usage

    const gulp = require('gulp')
    const userscript = require('gulp-userscript')
    
    gulp.task('userscript', function () {
      return gulp.src('/path/to/src.js')
        .pipe(userscript({
          name: 'Your Userscript name', // required
          namespace: 'namespace',
          version: '0.1',
          'run-at': 'document-end',
          // Use an array when the field has multiple values
          match: [
            'http://www.example.com/*',
            'https://www.example.com/*'
          ],
        }))
        .pipe(gulp.dest('/path/to/dest'))
    })

    will generate Userscript metadata like this:

    // ==UserScript==
    // @name Your Userscript name
    // @namespace namespace
    // @version 0.1
    // @run-at document-end
    // @match http://www.example.com/*
    // @match https://www.example.com/*
    // ==/UserScript==
    
    // ... /path/to/src.js content here

    For more options, see https://wiki.greasespot.net/Metadata_Block

    License

    MIT

    Install

    npm i gulp-userscript

    DownloadsWeekly Downloads

    2

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    5.31 kB

    Total Files

    5

    Last publish

    Collaborators

    • pd4d10
    • nbsp1221