Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
express-render-template
Advanced tools
Readme
This package in no longer supported and has been replaced by node-iframe-replacement
Use the HTML source of an external URL as an express layout template, a clean alternative to an iframe.
Extends res.render allowing an external URL to be used as a layout & CSS selector as a placeholder location to inject view content.
$ npm install --save express-render-template
The example below will request the Mammoth Workwear home page and replace the contents of #promo-banner with the contents of the view
var renderTemplate = require('express-render-template');
// replace res.render with renderTemplate version
app.use(renderTemplate);
// create a regular express route
app.get('/', function(req, res){
// call res.render as normal but pass template and selector rather than layout
res.render('view-name',{
template: 'http://mammothworkwear.com', // external url to use as layout page
templateSelector: '#promo-banner' // element within the layout to inject view content
});
});
<h1>20% off <a href="https://northseaworkwear.com/brands-dickies-fr-workwear/">Dickies Workwear</a></h1>
To ensure scripts, styles and images in the external template load on your site, the render method injects a HTML base tag <base href="http://mammothworkwear.com" />
. Therefore you need to ensure any links within your view are absolute.
ISC License © 2016 John Doherty
FAQs
Use the HTML source of an external URL as an express layout template (clean iframe alternative)
The npm package express-render-template receives a total of 11 weekly downloads. As such, express-render-template popularity was classified as not popular.
We found that express-render-template 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.