Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
angular-jsdom-renderer
Advanced tools
Helps render angular pages on the server-side.
npm install angular-jsdom-renderer
// render using an interval poll selector
var renderer = require('angular-jsdom-renderer');
renderer.render({
/* url to retrieve the html from */
url: 'http://localhost:7559/',
/* poll this selector until a match is found */
pollSelector: 'body[data-content-loaded=true]',
/* how often to poll the given selector. default 500 */
pollSelectorMs: 100,
/* how long to wait to give up polling selector. default 60000 */
timeoutMs: 60000,
/* complete callback. this = config */
done: function(errors, window) {
if (errors) {
console.log(errors);
return;
}
var document = window.document;
var compiledHtml = document.outerHTML;
// var angular = window.angular
console.log(compiledHtml);
// window will close after this callback
}
});
// render using a timeout only
var renderer = require('angular-jsdom-renderer');
renderer.render({
/* url to retrieve the html from */
url: 'http://localhost:7559/',
/* how long to wait until rendering the content. default 5000 */
timeoutMs: 5000,
/* complete callback. this = config */
done: function(errors, window) {
if (errors) {
console.log(errors);
return;
}
var document = window.document;
var compiledHtml = document.outerHTML;
// var angular = window.angular
console.log(compiledHtml);
// window will close after this callback
}
});
####Run the examples
/* renders the give url or file or html string */
render({
/* raw html. optional but must provide either url|file|html */
html: '',
/* raw file. optional but must provide either url|file|html */
file: config.file,
/* raw url. optional but must provide either url|file|html */
url: '',
/* injects script urls in to the html to be rendered */
scripts: [],
/* injects script statements in to the html to be rendered */
src: [],
/* see jsdom for more info - https://github.com/tmpvar/jsdom#how-it-works */
features: config.features,
/* see jsdom for more info - https://github.com/tmpvar/jsdom#doneerrors-window */
done: function(jsdomErrors, window){},
/* polls a selector until a match is found and then passes the rendered html to the config.done callback */
pollSelector: 'body[data-content-loaded=true]'. default '',
/* how often to poll the given selector. default 500 */
pollSelectorMs: 500,
/* how long to wait to give up polling selector. default 60000 */
timeoutMs: 60000,
});
Feel free to submit ideas and issues.
Licensed under the incredibly permissive MIT License
Copyright © 2014+ Stringz Solutions Ltd
Copyright © 2014+ Peter Flannery
FAQs
Helps render angular pages on the server-side.
The npm package angular-jsdom-renderer receives a total of 3 weekly downloads. As such, angular-jsdom-renderer popularity was classified as not popular.
We found that angular-jsdom-renderer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.