iiif-prezi2to3
Converts IIIF Presentation v2 to v3
Last updated a month ago by stephenwf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install iiif-prezi2to3 
SYNC missed versions from official npm registry.

IIIF Presentation v2 to v3 converter (Javascript)

Travis npm package Coveralls

The library is a direct javascript port of the IIIF/prezi-2-to-3, therefore it converts json-ld documents from IIIF Presentation v2 to v3.

demo

Istallation

Installing via npm:

npm install iiif-prezi2to3

Installing using yarn:

yarn add iiif-prezi2to3

Usage

Importing

Using with require:

var Upgrader = require('iiif-prezi2to3');

Using with es6 imports:

import Upgrader from 'iiif-prezi2to3';

From browser:

<script src="https://unpkg.com/iiif-prezi2to3/umd/iiif-prezi2to3.js" type="text/javascript"></script>

Instantiating

Convert javascript JSON:

let upgrader = new Upgrader({"deref_links " : false});

Converting

Processing in memory objects:

let resultObject = upgrader.processResource(input_manifest, true);

Processing urls:

let resultObject = upgrader.processUri(uri, true);

Constuctor flags

  • desc_2_md : The description property is not a summary, and hence should be put in as a metadata pair. The label generated will be "Description". The default is true.
  • related_2_md : The related property is not a homepage, and hence should be put in as a metadata pair. The label generated will be "Related". The default is false (and hence the property will simply be renamed as homepage)
  • ext_ok : Should extensions be copied through to the new version. The default is false.
  • default_lang : The default language to use for language maps. The default is "@none".
  • deref_links : Should links without a format property be dereferenced and the HTTP response inspected for the media type? The default is true.
  • debug : Are we in debug mode and should spit out more warnings than normal? The default is false

TODO/Roadmap

  • Increase code coverage
  • Rewrite tests using JEST
  • Drop nwb.
  • Add typings.
  • Reduce cyclomatic complexity for several functions including:
    • traverse
    • fixServiceType
    • fixType
    • fixObject
    • processGeneric
    • setRemoteType
    • processRange
    • processAnnotation
    • processResource

Current Tags

  • 2.0.2                                ...           latest (a month ago)

12 Versions

  • 2.0.2                                ...           a month ago
  • 2.0.1                                ...           a month ago
  • 2.0.0                                ...           a month ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago

Copyright 2014 - 2017 © taobao.org |