JS client for using Melinda API (Union catalogue of the National library of Finland)


002.0.02 years ago4 years agoMinified + gzip package size for @natlibfi/melinda-api-client in KB


melinda-api-client NPM Version Build Status Test Coverage

JS client for using Melinda API (Union catalogue of the National library of Finland)


npm install melinda-api-client


Usage examples can be found from the test/ directory. Each function returns a promise.

var MelindaClient = require('@natlibfi/melinda-api-client');

var client = new MelindaClient(config);

config should be in following format:

    endpoint: "API-ENDPOINT-URL",
    user: "USERNAME",
    password: "PASSWORD"

To retrieve a record from Melinda use loadRecord

client.loadRecord(30000).then(function(record) {
    // do something with record

The records are marc-record-js instances.

To update or create a record in Melinda use updateRecord and createRecord respectively

client.updateRecord(record).then(function(response) {
    // contains reponse from Melinda

client.createRecord(record).then(function(response) {
    // contains reponse from Melinda

The responses are in the following format:

    messages: [arrayOfMessages],
    errors: [arrayOfErrors],
    triggers: [arrayOfTriggerMessages],
    warnings: [arrayOfWarnings]
    recordId: "id of the changed/created record"


The grunt default task will run jshint, tests and coverage for the module. Tests can be found from test/ directory.

To test that everything is ok, just run:


The ci will do the same when commits are pushed to this repository.

License and copyright

Copyright (c) 2015-2017 University Of Helsinki (The National Library Of Finland)

This project's source code is licensed under the terms of GNU Lesser General Public License Version 3.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.