Socket
Socket
Sign inDemoInstall

thredds-catalog-crawler

Package Overview
Dependencies
3
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    thredds-catalog-crawler

A module for crawling thredds catalogs


Version published
Weekly downloads
240
decreased by-6.98%
Maintainers
3
Install size
307 kB
Created
Weekly downloads
 

Readme

Source

thredds-catalog-crawler

A package for crawling THREDDS catalogs, including nested catalogs.

Install

npm install thredds-catalog-crawler --save

Basic usage

Using async/await & modules

import threddsCrawler from 'thredds-catalog-crawler'

async function crawlThredds() {
    const catalog = await threddsCrawler('http://something/thredds/catalog/my/catalog.xml')
    await catalog.loadAllNestedCatalogs()
    const datasets = catalog.getAllChildDatasets()
}
crawlThredds()

Using traditional promises & modules

const threddsCrawler = require('thredds-catalog-crawler')

threddsCrawler('http://something/thredds/catalog/my/catalog.xml')
.then(function (catalog) {
    catalog.loadAllNestedCatalogs()
})

Dependencies

This package uses the Fetch API. If you're using this library in NodeJS you'll need a fetch polyfill like isomorphic-fetch or if you want to support older browsers we'd suggest unfetch. You may also need a URL API polyfill such as url-polyfill for older browsers.

import 'isomorphic-fetch'
import 'url-polyfill'
import threddsCrawler from 'thredds-catalog-crawler'

API

Catalog

A Catalog represents the root object in a THREDDS heirarchy. Catalogs can contain datasets, as well as references to other catalogs.

Properties
PropertyTypeDescription
urlStringUrl of the catalog
nameStringName of the catalog
isLoadedBooleanIndicates whether the endpoint has been loaded. If true then datasets and services will be populated, and limited catalog information. If false then most information will be unavailable.
datasetsArrayAn array of datasets found in the catalog
catalogsArrayAn array of nested catalogs found in the catalog
servicesObjectAn object containing the available services for a catalog, organised by service type
hasDatasetsBooleanIndicates whether the catalog contains datasets directly
hasNestedCatalogsBooleanIndicates whether the catalog contains nested catalogs
wmsBaseStringThe base url for a WMS service. If no WMS support is available then null
supportsWmsBooleanDoes a catalog have a WMS service for datasets
Methods
MethodReturnsDescription
loadAllNestedCatalogsN/ALoads all nested catalogs recurrsively
loadNestedCatalogById(id)CatalogCrawls a single nested catalog based on a id string
getAllChildDatasetsArray[Dataset1, Dataset2...]Returns a flattened array of datasets from all nested catalogs which have been loaded.

Dataset

A Dataset can contain datasets, as well as references to other catalogs.

Properties
PropertyTypeDescription
idStringAn id of the dataset
nameStringName of the dataset
parentObjectA catalog or another dataset
urlPathStringPartial url path of the dataset
isParentDatasetBooleanIndicates whether this dataset contains other datasets
datasetsArray[Dataset]An array of nested datasets
wmsUrlStringA url for the GetCapabilities endpoint for the dataset. Constructed from the dataset and its parent catalog item
parentCatalogCatalogA reference to the datasets parent catalog
supportsWmsBooleanDoes this dataset have a WMS available
Methods
MethodReturnsDescription
loadAllNestedCatalogsN/ALoads all nested catalogs recurrsively

FAQs

Last updated on 21 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc