Socket
Socket
Sign inDemoInstall

express-seo

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    express-seo

Express plugin to easily improve the SEO/social media crawling of your web apps.


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
0.956 MB
Created
Weekly downloads
 

Readme

Source

Express-seo

Express plugin to easily improve the SEO/social media crawling of your web apps.

What is it ?

More and more websites process templates on the client side with the use of frameworks like Angular.js and as you must know, search engines and social media bots (Facebook, twitter...) don't execute javascript when crawling your pages, so basically without some work on the server side, your SEO sucks. This plugin aims to provide all the necessary tools for your SEO & social media sharing with a Node.js app using Express. Moreover this give you more flexibility and its easier to put in place than libraries using PhantomJS to generate static pages.

How to install

npm install express-seo --save

How to use

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

// For internatanalization, set the supported languages
seo.setConfig({
	langs: ["en", "fr"]
});

// Set the default tags
seo.setDefaults({
	html: "<a href='https://twitter.com/MaximeMezrahi'>Follow me on twitter</a>" // Special property to insert html in the body (interesting to insert links)
	title: "Awesome website", // Page title
	// All the other properties will be inserted as a meta property
	description: {
		en: "Check out my awesome website",
		fr: "Decouvez mon incroyable site"
	},
	image: "https://assets-cdn.github.com/images/modules/dashboard/bootcamp/octocat_setup.png"
});

// Create an seo route
seo.add("/contact", function(req, opts, next) {
	/*
	req: Express request
	opts: Object {
		service: String ("facebook" || "twitter" || "search-engine")
		lang: String (Detected language)
	}
	*/
	next({
		description: "Amazing contact page"
	});
});

If you use HTML5 URL scheme then you should let the crawler know you're serving an AJAX application by adding the following to the HEAD tag of your page:

<meta name=”fragment” content=”!”>

License

(The MIT License)

Copyright (c) 2015 Maxime Mezrahi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Last updated on 01 Apr 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc