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

choo-meta

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

choo-meta

Update document meta tags on event

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

choo-meta

npm version build status downloads style

Keeps document meta tags up to date. Drop-in replacement for choo native DOMTitleChange event.

Usage

Add the plugin as you would any other choo store.

var choo = require('choo')
var app = choo()
app.use(require('choo-meta')())
app.mount('body')

And switch out all your DOMTitleChange events for meta events with an object of meta properties to update. Will forward to DOMTitlteChange under the hood to preserve choo behaviour.

- emit('DOMTitleChange', 'My Website')
+ emit('meta', { title: 'My Website', 'og:image': '/logo.jpg' })

API

emit([opts])

Create a choo store which listens for the meta event. Will lookup meta tags in document head and update them in place, optionally adding new tags if not found.

Options

  • append (default: true) create and append new meta tags if they can't be found
  • origin webpage domain used for resolving relative urls and adding the og:url property

License

MIT

Keywords

FAQs

Package last updated on 15 Jan 2019

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