@natlibfi/marc-record-validate

8.0.9-alpha.1 • Public • Published

Validate and fix MARC records NPM Version Test Coverage

Javascript module to validate and fix MARC records.

Usage

import {DoubleCommas} from '@natlibfi/marc-record-validators-melinda';
import validateFactory from '@natlibfi/marc-record-validate';

async function run() {
  const validate = validateFactory([await DoubleCommas()]);
  const result = await validate(marcRecord);
}

Configuration

The module returns a factory function that takes an array of validators as an argument. The factory creates a validate function that takes a MARC record instance and optional options as an object:

  • fix: Whether to run fix-method of the validator or not. Defaults to false
  • failOnError: Do not running remaining validators if the record does not validate (And cannot be fixed if fix is set to true). Defaults to false
  • validateFixes: Re-run validators after all validators have been processed. Only the validate-method will be called so that fixes are not applied twice. Defaults to false

Validators

See marc-record-validators-melinda for reference on how to write validators.

License and copyright

Copyright (c) 2014-2019, 2022-2024 University Of Helsinki (The National Library Of Finland)

This project's source code is licensed under the terms of MIT or any later version.

Readme

Keywords

none

Package Sidebar

Install

npm i @natlibfi/marc-record-validate

Weekly Downloads

252

Version

8.0.9-alpha.1

License

MIT

Unpacked Size

42.6 kB

Total Files

12

Last publish

Collaborators

  • natlibfi-jonollil
  • drone-melinda
https://www.npmjs.com/package/@natlibfi/marc-record-validate
www.npmjs.com
CC-MAIN-2024-30
102551
application/http; msgtype=response
sha1:7IVG6YWXA4RU7GGQ6SP4YCM6RKSTVKCQ
<urn:uuid:f7b42618-e96f-40eb-bbb6-8e4845cab000>
2024-07-19T16:42:43Z
104.17.223.175
text/html
sha1:Y353WSXMNWIYYXNWQ4AE54IM7TNY7KGU
<urn:uuid:b07dafa7-fb8f-4107-bacd-f3132e1adbd6>
https://www.npmjs.com/package/@natlibfi/marc-record-validate
response
<urn:uuid:b34ce802-9936-4363-99ef-b08b4ed1ba65>
isPartOf: CC-MAIN-2024-30
publisher: Common Crawl
description: Wide crawl of the web for July 2024
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-168
software: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/