mozilla / page-metadata-parser

DEPRECATED - A Javascript library for parsing metadata on a web page.
https://www.npmjs.com/package/page-metadata-parser
Mozilla Public License 2.0
270 stars 42 forks source link

Usage in browser instructions #93

Closed pantchox closed 7 years ago

pantchox commented 7 years ago

Hi, I want to use this lib in the browser but there is only nodejs example. also the Parser.js file uses node "require" function which is not browser compatiable.

Any advice on this?

thanks

jaredlockhart commented 7 years ago

@pantchox Hi! You can absolutely use this in the browser, in fact our unit tests include testing it in FIrefox. You can make a browser deployable version by running:

npm run clientize

which can be found here: https://github.com/mozilla/page-metadata-parser/blob/master/package.json#L56

This will create a js file that you can drop right into a browser and run directly which you can find here:

client/page-metadata-parser.bundle.js

Let me know if this works! Thanks for trying out the library :)