Managing .odt files with node - LibreOffice · Managing .odt files with node.js – Gabriele...

Post on 06-Jun-2020

36 views 0 download

Transcript of Managing .odt files with node - LibreOffice · Managing .odt files with node.js – Gabriele...

Managing .odt files with node.jsGabriele Falasca

Managing .odt files with node.js – Gabriele Falasca

Who am I?

● Gabriele Falasca (aka gabrycaos)● Frontend developer @Sourcesense ● Javascript enthusiast● Open source lover● Bassist during free time● /gabrycaos on facebook● @gabrycaos on twitter● gabriele.falasca@sourcesense.com

Managing .odt files with node.js – Gabriele Falasca

.odt format

I don’t need to explain what is it here :)

Managing .odt files with node.js – Gabriele Falasca

Node.js

Javascript V8 engine for writing server side applications.

Managing .odt files with node.js – Gabriele Falasca

Node.js: async and event driven

Syncronous Flow:

Data request

Waiting for data

Data request

Data!

Waiting for data

Other actions

Data requestData request

Data!

Waiting for data

Other actions

Async Flow:

Managing .odt files with node.js – Gabriele Falasca

Node.js: async and event driven

// sync functionconst data = getData(params)

// make something with data variable

---

// async functiongetData(params, (data) => {

// make something with data variable

})

Managing .odt files with node.js – Gabriele Falasca

Node.js: Stream

A sort of data-flow divided in chunk, that goes from a Producer to a Consumer, event driven.

A stream can be:

●Readable,●Writable, ●Duplex, ●Transform

Managing .odt files with node.js – Gabriele Falasca

.odt files structure

● mimetype● Thumbnails/● content.xml● Configurations2/● manifest.rdf● styles.xml● settings.xml● meta.xml● META-INF

Managing .odt files with node.js – Gabriele Falasca

content.xml structure in the editor!

Managing .odt files with node.js – Gabriele Falasca

Let’s see some code!

Managing .odt files with node.js – Gabriele Falasca

Let’s see some code!

Managing .odt files with node.js – Gabriele Falasca

Let’s see the rest of the code directly in the editor!

Managing .odt files with node.js – Gabriele Falasca

QUESTIONS?!

Demo code can be found on https://github.com/gabrycaos/node-odt-managment-demo