protocol-parser

0.0.7 • Public • Published

protocol-parser

Parse metatags for various protocols: OGP, Twitter, citation, DC and OSMT supported.

NPM

Installation

$ npm install protocol-parser

Usage

var protocolParser = require('protocol-parser')
 
protocolParser.isProfileCompliant(window, 'os', 'https://github.com/RichardLitt/open-source-metatags/')
=> true
 
protocolParser.parse(window, ['os', 'twitter'])
=> {
  'os': {
    repo: "https://github.com/RichardLitt/open-source-metatags", 
    rcs_type: "git", 
    src: "git@github.com:RichardLitt/open-source-metatags.git", 
    issue: "https://github.com/RichardLitt/open-source-metatags/issues"
  },
  'twitter': {...}
}
 
protocolParser.standardProtocols()
=> {
  'citation': {...},
  'dc': {...},
  'og': {...},
  'os': {...},
  'twitter': {...}
}

Credits

Written and maintained by Richard Littauer.

Package Sidebar

Install

npm i protocol-parser

Weekly Downloads

5

Version

0.0.7

License

MIT

Last publish

Collaborators

  • richardlitt