
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
pub-generator
Advanced tools
pub-pkg-editorpub-generator is included with pub-server and runs as part of the server.
the server instantiates a single generator as follows:
// resolve config
var opts = require('pub-resolve-opts')(opts, path.join(__dirname, 'node_modules'));
// instatiate generator
var generator = require('pub-generator')(opts);
// install plugins
u.each(opts.generatorPlugins, function(plugin) {
require(plugin.path)(generator);
});
// read all sources and compile
generator.load(cb)
a minimal express page renderer would look like this:
app.get(function(req, res, next) {
var page = generator.findPage(req.url);
if (!page) return next();
res.send(generator.renderDoc(page));
});
pub-server can deliver the generator to clients in browserified form at /pub/_generator.js.
Here is a slightly simplified version of this (jQuery) script. Options and plugins are retrieved separately for caching reasons.
$.getJSON('/pub/_opts.json')
.fail(function(jqXHR) { alert('unable to load /pub/_opts.json'); })
.done(function(respData) {
// opts includes source.file data for all sources
// see pub-server serve-scripts
var opts = respData;
// start client-side pub-generator
var generator = window.generator = require('pub-generator')(opts);
// get browserified generator plugins - avoid caching across directories
$.getScript('/pub/_generator-plugins.js?_=' + encodeURIComponent(opts.basedir))
.fail(function(jqXHR) { alert('unable to load generator plugins'); })
.done(function(script) {
generator.load(function(err) {
if (err) return opts.log(err);
// slightly ugly way to notify client (editor) that generator is ready
if (window.onGeneratorLoaded) {
window.onGeneratorLoaded(generator);
}
});
});
});
FAQs
markdown/handlebars site generator - runs in node or browser
The npm package pub-generator receives a total of 29 weekly downloads. As such, pub-generator popularity was classified as not popular.
We found that pub-generator demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.