JSPM

anchors

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 192
  • Score
    100M100P100Q81364F

Extract anchor tags from HTML and parse them into objects with useful information.

Package Exports

  • anchors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (anchors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

anchors NPM version

Extract anchor tags from HTML and parse them into objects with useful information.

Install with npm:

npm i -g anchors --save-dev

Usage

var anchors = require("anchors");
console.log(anchors);

Returns an object like the following for each anchor tag:

{
  "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

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license


This file was generated by Phaser on March 14, 2014.