1.1.0 • Published 9 years ago

meta-tag-data v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

meta-tag-data Build Status

Convert key/value pairs to tag data

Install

$ npm install --save meta-tag-data

Usage

var metaData = require('meta-tag-data')

metaData('name', {
  description: 'foo',
  keywords: 'bar'  
})
//=> [{name: 'description', content: 'foo'}, {name: 'keywords', content: 'bar'}]

API

metaData(key, data) -> array[object]

key

Required
Type: string

The string attribute key to use for the meta keys (name for many tags and property for Open Graph tags).

data

Required
Type: object

An object with key/value pairs that will become meta keys and meta content values. Keys are converted to dash case. Values are passed through meta-string which stringifies objects.

License

MIT © Ben Drucker