diff --git a/README.md b/README.md index ef73502..c025e94 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,34 @@ console.log(scripts) // ] ``` +### Other tags + +`elements` reads any set of tags with the same HTML parsing rules, and returns their attributes the way a browser DOM has them: values are strings, and a repeated attribute keeps its first value. + +```js +const { elements } = require('html-scripts') + +const { meta, script } = elements( + '', + ['meta', 'script'] +) + +console.log(meta) +// [ { name: 'generator', content: 'WordPress 6.4' } ] + +console.log(script) +// [ { async: '', src: '/app.js' } ] +``` + +Tag names are lowercase. Tags inside `