
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
generate-userscript-header
Advanced tools
Generates a userscript header string to append to your scripts.
This module generates a userscript header string to append to your scripts.
First install: npm install generate-userscript-header
Then you can use it:
var generateUserscriptHeader = require('generate-userscript-header');
var userscript = {
'name': 'ACME Userscript Maker',
'namespace': 'http://example.com/',
'author': '{{{pkg.author}}}',
'homepage': '{{{pkg.homepage}}}',
'grant': 'none',
'include': [
'http://google.com/*',
'https://google.com/*'
]
};
var context = {
pkg: {
author: 'John Doe',
homepage: 'http://example.com/johndoe'
}
};
var header = generateUserscriptHeader(userscript, context);
console.log(header);
Output:
// ==UserScript==
// @name ACME Userscript Maker
// @namespace http://example.com/
// @author John Doe
// @homepage http://example.com/johndoe
// @grant none
// @include http://google.com/*
// @include https://google.com/*
// ==/UserScript==
This module exports a single method that outputs a userscript metadata block as a string given the data to convert. Data is parsed with mustache and replaced with the data of a certain context.
var generate = require('generate-userscript-header');
generate(userscript, context)
| Name | Type | Description |
|---|---|---|
| userscript | object | The object containing the userscript data. |
| context | object | The data used to parse values with mustache. Use {{{yourKey}}} in the data to parse. |
| Type | Description |
|---|---|
| string | The finalized metadata block. |
FAQs
Generates a userscript header string to append to your scripts.
The npm package generate-userscript-header receives a total of 0 weekly downloads. As such, generate-userscript-header popularity was classified as not popular.
We found that generate-userscript-header demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.