ers-utils

0.3.5 • Public • Published

ERS Utils

Greenkeeper badge Build Status codecov Coverage Status

The aime of this library is to help parsing the data coming from Cloud CMS.

  • It parses dates according to the ERS corporate guidelines
  • It pasrses markdown to html
  • Formats the calendar
  • Generates url for documents and images
  • ...

The composition module helps reducing the amount of maping necessary to parse items as an item is mapped once and the passed to each of the methods. For this purposes there are some convinience methods that take an item/article as an input and outputs an updated items. The full object is passed from method to method. This is not fully functional as it gets mutated at every setps.

Install

$ npm install --save ers-utils

Use

    const C = require('../../lib/library').Composition;
    const cp = new C(); // now it is classes, thus it needs instantiation
    const F = require('ers-utils').Format;
    const format = new F();
    const D = require('ers-utils').DateUtil; // the name of the class has changed
    const date = new D();
    const Fp = require('ers-utils').Fp;
    const fp = new Fp();

Tests

Run test as follow:

$ npm run test

Collaborate

I do not know who might need this, but if someone finds any interest some ERS logic could be abstracted further away...

Change log

  • 0.2.7 introduces recursive parsing of images (was true before) and documents (new)
    • the following property are necessary: image and document all other ones are ignored

Package Sidebar

Install

npm i ers-utils

Weekly Downloads

19

Version

0.3.5

License

ISC

Unpacked Size

132 kB

Total Files

11

Last publish

Collaborators

  • europeanrespiratorysociety
  • idealley