magnetic
v0.1.2
Published
Magnetic is a tool that makes it easy to fetch web pages that may have dynamic content and render them to static HTML.
Downloads
18
Maintainers
Readme
magnetic
Magnetic uses PhantomJS and Horseman to fetch web pages that may have dynamic content and render them to static HTML. This makes it easy for you to add automatic server-side static rendering to your dynamic single-page app.
Example using a script
var Magnetic = require('magnetic');
var magnetic = new Magnetic();
var html = magnetic.render('http://example.org/#!/somePage');
The html
variable will contain the complete rendered page after scripts have run.
Example from the command line
sudo npm install -g magnetic
magnetic http://example.org/#!/somePage
Express
Please see magnetic-express for an easy way to add Magnetic to your Express app in a way that is compatible with search engine crawlers.