# magnetic

> Magnetic is a tool that makes it easy to fetch web pages that may have dynamic content and render them to static HTML.

Latest version **0.1.2** (published 2015-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install magnetic
pnpm add magnetic
yarn add magnetic
bun add magnetic
```

Provides the command `magnetic`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2015-07-17 |
| First published | 2015-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | James Barton |
| Maintainers | neodon1014 |
| Keywords | magnetic, prerender, googlebot, crawl, crawler, search index |

## Links

- npm: https://www.npmjs.com/package/magnetic
- Repository: https://github.com/neodon/magnetic
- Issues: https://github.com/neodon/magnetic/issues
- npm.io page: https://npm.io/package/magnetic

## Dependencies (4)

- [pkginfo](https://npm.io/package/pkginfo.md) ^0.3.0
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [phantomjs](https://npm.io/package/phantomjs.md) ^1.9.17
- [node-horseman](https://npm.io/package/node-horseman.md) ^1.5.3

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-07-17
- 0.1.1 — 2015-07-17
- 0.1.0 — 2015-07-16
- 0.0.1 — 2015-07-16

## README

# magnetic

Magnetic uses [PhantomJS](http://phantomjs.org/) and
[Horseman](https://github.com/johntitus/node-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](https://github.com/neodon/magnetic-express)
for an easy way to add Magnetic to your Express app in a way that is
compatible with search engine crawlers.

---
_Source: https://npm.io/package/magnetic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
