Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.