Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

seo

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

seo

A connect middleware that serves html snapshots of single page apps

  • 0.0.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

node-seo Build Status

node-seo is a connect middleware that can generate, cache and serve HTML snapshots of single page web apps for search bots. Uses PhantomJS for generating snapshots.

Installation

via npm:

$ npm install seo

Configuration

node-seo can be used as a middleware for connect/express, like this:

var express = require('express');
var seo  = require('seo');
var app = express();

app.use(new seo({
  cacheDirectory: path.resolve(process.cwd(), '.seo-cache'),
  routes: require('./seo-routes'),
  requestURL: 'http://localhost:8080',
  pageModifier: function (page, callback) {
    // This function can be used to modify a page before it is cached
    // `page` is an instance of PhantomJS's Page object. For an example
    // see `test/middleware.test.js`
  }
}).init());

app.listen(8080);

In this case, node-seo will use seo-routes.js to check whether it should create a snapshot for the current path. This file should export a function that returns a boolean. The first parameter is the current request:

module.exports = function (request) {
  if (request.path === '/') return true;
  return false;
}

Todo

  • Ability to pre-render (initial rendering can take some time and we don't want to affect our search engine ranking by slow rendering times)

Keywords

FAQs

Package last updated on 06 Jul 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc