10.1.2 • Published 6 months ago

@natlibfi/marc-record-serializers v10.1.2

Weekly downloads
116
License
MIT
Repository
github
Last release
6 months ago

Convert records to and from different MARC formats

NPM Version Node Version Build Status Test Coverage

NOTE: UPGRADING FROM VERSION 7 -> 8

All readers are now functions instead of classes.

Replace

const reader = new MARCXML.Reader(fs.createReadStream('marc.xml'));

with

const reader = MARCXML.reader(fs.createReadStream('marc.xml'));

when using readers.

NOTE: UPGRADING FROM VERSION 6 -> 7

MARCXML.to is now asynchronous.

NOTE: UPGRADING FROM VERSION 5 -> 6

MARCXML.from is now asynchronous because the underlying XML module uses callbacks for errors.


Convert records to and from different MARC formats. Deserializes MARC to @natlibfi/marc-record.

This a fork of the original marc-record-serializers. The new implementation uses ES6 syntax.

Usage

Module

import fs from 'fs';
import {MARCXML} from '@natlibfi/marc-record-serializers';
const reader = MARCXML.reader(fs.createReadStream('marc.xml'));

reader.on('data', record => console.log(record));

Serializers

MARCXML

  • reader: The third argument is a XML namespace prefix used in marcxml (fe. 'marc'). Defaults to no prefix.
  • from: The second argument is a validation options object (See @natlibfi/marc-record)
  • to: An object can be passed in as the second argument. It supports the following properties:
    • omitDeclaration: Whether to omit XML declaration. Defaults to false.
    • indent: Whether to indent te XML. Defaults to false.

Aleph Sequential

  • to: If second argument useCrForContinuingResources is true, uses 'CR' in FMT field for continuing resources, otherwise uses Aleph standard 'SE'. Defaults to false.

CLI

npx @natlibfi/marc-record-serializers

License and copyright

Copyright (c) 2014-2017 Pasi Tuominen pasi.tuominen@gmail.com

Copyright (c) 2018-2021 University Of Helsinki (The National Library Of Finland)

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

10.0.6

9 months ago

10.0.7

9 months ago

10.0.6-alpha.1

9 months ago

10.0.6-alpha.2

9 months ago

10.1.2-alpha.2

6 months ago

10.1.2-alpha.1

6 months ago

10.1.2-alpha.3

6 months ago

10.0.7-alpha.1

9 months ago

10.1.1-alpha.1

8 months ago

10.1.0

9 months ago

10.1.1

8 months ago

10.1.2

6 months ago

10.1.0-alpha.3

9 months ago

10.1.0-alpha.4

9 months ago

10.1.0-alpha.1

9 months ago

10.1.0-alpha.2

9 months ago

10.1.0-alpha.5

9 months ago

10.0.5

11 months ago

10.0.5-alpha.1

11 months ago

10.0.0

1 year ago

10.0.1

1 year ago

10.0.2

1 year ago

1.0.4

1 year ago

10.0.4

1 year ago

10.0.1-alpha.1

1 year ago

10.0.3-alpha.2

1 year ago

10.0.3-alpha.1

1 year ago

10.0.3-alpha.3

1 year ago

10.0.0-alpha.1

1 year ago

9.0.4

1 year ago

9.0.3

2 years ago

9.0.2

2 years ago

9.0.1

2 years ago

9.0.0

2 years ago

9.0.0-alpha.4

2 years ago

9.0.0-alpha.3

2 years ago

7.2.12-alpha.1

2 years ago

8.0.4

2 years ago

8.1.0

2 years ago

8.0.4-alpha.1

2 years ago

8.0.1

3 years ago

8.0.2

3 years ago

8.0.0-alpha.1

3 years ago

7.2.13

3 years ago

8.0.0

3 years ago

7.2.9

3 years ago

7.2.11

3 years ago

7.2.10

3 years ago

7.2.8

3 years ago

7.2.7

3 years ago

7.2.6

3 years ago

7.2.4

3 years ago

7.2.3

3 years ago

7.2.2

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

7.1.6

4 years ago

7.1.5

4 years ago

7.1.4

4 years ago

7.1.3-alpha.1

4 years ago

7.1.3

4 years ago

7.1.2-alpha.1

4 years ago

7.1.2

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.2.1

4 years ago

6.2.0

4 years ago

6.1.0

4 years ago

6.0.0

4 years ago

5.0.3

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.0.5

5 years ago

3.0.4

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago