magnetic

0.1.2 • Public • Published

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.

Package Sidebar

Install

npm i magnetic

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • neodon1014