Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
thredds-catalog-crawler
Advanced tools
Readme
A package for crawling THREDDS catalogs, including nested catalogs.
npm install thredds-catalog-crawler --save
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()
})
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'
A Catalog
represents the root object in a THREDDS heirarchy. Catalogs can contain datasets, as well as references to other catalogs.
Property | Type | Description |
---|---|---|
url | String | Url of the catalog |
name | String | Name of the catalog |
isLoaded | Boolean | Indicates 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. |
datasets | Array | An array of datasets found in the catalog |
catalogs | Array | An array of nested catalogs found in the catalog |
services | Object | An object containing the available services for a catalog, organised by service type |
hasDatasets | Boolean | Indicates whether the catalog contains datasets directly |
hasNestedCatalogs | Boolean | Indicates whether the catalog contains nested catalogs |
wmsBase | String | The base url for a WMS service. If no WMS support is available then null |
supportsWms | Boolean | Does a catalog have a WMS service for datasets |
Method | Returns | Description |
---|---|---|
loadAllNestedCatalogs | N/A | Loads all nested catalogs recurrsively |
loadNestedCatalogById(id) | Catalog | Crawls a single nested catalog based on a id string |
getAllChildDatasets | Array[Dataset1, Dataset2...] | Returns a flattened array of datasets from all nested catalogs which have been loaded. |
A Dataset
can contain datasets, as well as references to other catalogs.
Property | Type | Description |
---|---|---|
id | String | An id of the dataset |
name | String | Name of the dataset |
parent | Object | A catalog or another dataset |
urlPath | String | Partial url path of the dataset |
isParentDataset | Boolean | Indicates whether this dataset contains other datasets |
datasets | Array[Dataset] | An array of nested datasets |
wmsUrl | String | A url for the GetCapabilities endpoint for the dataset. Constructed from the dataset and its parent catalog item |
parentCatalog | Catalog | A reference to the datasets parent catalog |
supportsWms | Boolean | Does this dataset have a WMS available |
Method | Returns | Description |
---|---|---|
loadAllNestedCatalogs | N/A | Loads all nested catalogs recurrsively |
FAQs
A module for crawling thredds catalogs
The npm package thredds-catalog-crawler receives a total of 205 weekly downloads. As such, thredds-catalog-crawler popularity was classified as not popular.
We found that thredds-catalog-crawler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.