Skip to content

pd4d10/gulp-userscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Generate Userscript metadata.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •