1.1.21 • Published 7 months ago

ut-function.xjx v1.1.21

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

ut-function.xjx - Load XML to Object and Object to XML handlers from a folder

Usage

Note: this function is intended to be used by microservices, based on ut-microservice, that's why its signature may look a bit complicated. For more information, see ut-microservice/xml.md

Create template files in a folder, by using the following naming convention:

  • name1.parse.xml - create a handler namer name1 for parsing XML to JSON
  • name2.render.xml - create a handler named name2 for rendering JSON to XML
const xjx = require('ut-function.xjx');

async function test() {
  const handlers = (await xjx(fs, __dirname))();
  await handlers.name1({payload: xml}); // will return object from the parsed XML
  await handlers.name2(params, $meta); // will return XML string
}

See index.test.js for more details.

1.1.21

7 months ago

1.1.19

10 months ago

1.1.18

12 months ago

1.1.20

10 months ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago