Skip to content

Repository files navigation

html-scripts

Last versionCoverage StatusNPM Status

It parses HTML markup and returns you all the scripts.

Install

$ npm install html-scripts --save

Usage

constgetScripts=require('html-scripts')constscripts=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>&mdash; 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

About

Parse HTML markup and extract every script tag, source URL, and inline script content.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages