JSPM

gulp-userscript

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18
  • Score
    100M100P100Q44621F
  • License MIT

Generate Userscript metadata with gulp.

Package Exports

  • gulp-userscript

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-userscript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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