npm

Need private packages and team management tools?Check out npm Orgs. »

xml-urls

2.1.8 • Public • Published

xml-urls

Last version Build Status Coverage Status Dependency status Dev Dependencies Status NPM Status Donate

Get all urls from a Feed/Atom/RSS/Sitemap xml markup.

Install

$ npm install xml-urls --save

Usage

const xmlUrls = require('xml-urls')
 
;(async () => {
  const url = process.argv[2]
  if (!url) throw new TypeError('Need to provide an url as first argument.')
  const urls = await xmlUrls(url)
 
  urls.forEach(url => console.log(url))
 
  // => [
  //  'http://www.sitemappro.com/',
  //  'http://www.sitemappro.com/download.html',
  //  'http://www.sitemappro.com/register.html',
  //  'http://www.sitemappro.com/examples.html',
  //  'http://www.sitemappro.com/company.html',
  //  'http://www.sitemappro.com/contact.html',
  //  ...
  // ]
})()

See more at examples.

API

xmlUrls(urls, [options])

url

Required
Type: string

options

Type: object

Use it for providing html-get#options.

whitelist

Type: array
Default: []

A list of links to be excluded from the final output. It supports regex patterns.

See [matcher](https://github.com/sindresorhus/matcher#matcher-= for know more.

Related

  • html-urls – Get all urls from a HTML markup.
  • css-urls – Get all URLs referenced from stylesheet files.

License

xml-urls © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub @Kiko Beats · Twitter @Kikobeats

install

npm i xml-urls

Downloadsweekly downloads

55

version

2.1.8

license

MIT

homepage

nicedoc.io

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability