html-scripts
v1.0.9
Published
It parses HTML markup and returns you all the scripts.
Downloads
99
Maintainers
Readme
html-scripts
It parses HTML markup and returns you all the scripts.
Install
$ npm install html-scripts --save
Usage
const getScripts = require('html-scripts')
const scripts = getScripts('<blockquote class="twitter-tweet"><p lang="en" dir="ltr">our new shiny website has landed <a href="https://t.co/KIrhYYcTRx">https://t.co/KIrhYYcTRx</a> <a href="https://t.co/cM0se2UoIg">pic.twitter.com/cM0se2UoIg</a></p>— microlink.io (@microlinkhq) <a href="https://twitter.com/microlinkhq/status/1032664633960800257?ref_src=twsrc%5Etfw">August 23, 2018</a></blockquote>\n<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>\n')
console.log(scripts)
// [
// {
// async: null,
// charset: 'utf-8',
// src: 'https://platform.twitter.com/widgets.js',
// },
// ]
License
html-scripts © Kiko Beats, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats