script-tags
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "script-tags", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": [ | ||
@@ -5,0 +5,0 @@ "index.js" |
@@ -14,35 +14,9 @@ # {%= name %} [![NPM version](https://badge.fury.io/js/{%= name %}.png)](http://badge.fury.io/js/{%= name %}) | ||
```js | ||
var {%= name %} = require("{%= name %}"); | ||
console.log(script-tags); | ||
var scripts = require("script-tags"); | ||
console.log(scripts('<script>var foo = "bar";</script>')); | ||
``` | ||
Returns an object like the following for each anchor tag: | ||
Returns an object with info for each script tag. See [an example](./test/example.json). | ||
```json | ||
{ | ||
"class": "link", | ||
"title": "Assemble Docs", | ||
"name": "", | ||
"alt": "", | ||
"rel": "", | ||
"href": { | ||
"protocol": "https:", | ||
"slashes": true, | ||
"auth": null, | ||
"host": "github.com", | ||
"port": null, | ||
"hostname": "github.com", | ||
"hash": null, | ||
"search": null, | ||
"query": null, | ||
"pathname": "/assemble/assemble-docs/blob/master/LICENSE-MIT", | ||
"path": "/assemble/assemble-docs/blob/master/LICENSE-MIT", | ||
"href": "https://github.com/assemble/assemble-docs/blob/master/LICENSE-MIT" | ||
} | ||
} | ||
``` | ||
## Author | ||
{%= contrib("jon") %} | ||
@@ -49,0 +23,0 @@ |
{ | ||
"name": "script-tags", | ||
"version": "0.0.2", | ||
"description": "Utils for HTML script tags.", | ||
"version": "0.0.3", | ||
"description": "Utils for HTML script tags. Extracts script tags from HTML and parse them into objects with useful information.", | ||
"homepage": "https://github.com/jonschlinkert/script-tags", | ||
@@ -6,0 +6,0 @@ "author": { |
# script-tags [![NPM version](https://badge.fury.io/js/script-tags.png)](http://badge.fury.io/js/script-tags) | ||
> Extract anchor tags from HTML and parse them into objects with useful information. | ||
> Extract script tags from HTML and parse them into objects with useful information. | ||
@@ -18,2 +18,3 @@ ## Install with [npm](npmjs.org): | ||
Returns an object with info for each script tag. See [an example](./test/example.json). | ||
@@ -20,0 +21,0 @@ ## Author |
@@ -20,3 +20,4 @@ /** | ||
console.log(JSON.stringify(scripts, null, 2)); | ||
file.writeFileSync('test/example.json', JSON.stringify(scripts, null, 2)); | ||
1162655
47
685
34