Socket
Book a DemoInstallSign in
Socket

csw-client

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csw-client

A very simple CSW client

latest
Source
npmnpm
Version
0.18.3
Version published
Maintainers
1
Created
Source

csw-client CircleCI

A very simple CSW client

npm version dependencies Status codecov XO code style

Prerequisite

  • Node.js >= 8.0

Features

  • Fetch capabilities
  • Fetch records
  • Harvest (w/ Stream API)
  • Support ISO 19139 (including Inspire profile)
  • Support Dublin Core

Installation

npm install csw-client

Usage

Create a client

const csw = require('csw-client');
const client = csw('http://your-csw-server.tld/csw', options);

Options

NameDescriptionTypeDefault value
userAgentUser-Agent string you want to use in requestsstring"CSWBot"
gzipenable compressionbooleantrue
timeoutrequests will fail after X msintegerdisabled

Harvest

Stream API

client.harvest(options).pipe(outputStream);

Alternative

client.harvest(options)
    .on('record', record => console.log(record.type))
    .on('error', err => console.error(err))
    .on('end', () => console.log('Finished!'))
    .resume();

Options

NameDescriptionTypeDefault value
stepnumber of records asked by GetRecords requestinteger20
concurrencynumber of concurrent GetRecords requestsinteger5

Events

NameDescriptionProperties
recorda new record is foundtype: record type
body: parsed value
startedharvesting has startednone
failedharvesting has failednone
endharvesting has endednone

Keywords

CSW

FAQs

Package last updated on 27 Nov 2019

Did you know?

Socket

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