meta-tag-data
v1.1.0
Published
Convert key/value pairs to <meta> tag data
Downloads
18
Maintainers
Readme
meta-tag-data
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