npm.io
0.1.1 • Published 7 years ago

powerp.js

Licence
MIT
Version
0.1.1
Deps
2
Size
14 kB
Vulns
0
Weekly
0
Stars
1

PowERP.js

Javascript client for PowERP and MessagePack protocol.

Example

import Client from 'powerp';


const c = new Client('http://localhost:8068', 'test', 'admin', 'admin');
c.login().then(() => {
    const model = c.model('res.partner');
    model.search([['name', 'ilike', 'asus']]).then((ids) => {
        model.read(ids, ['name', 'vat']).then((results) => {
            results.map((result) => {
                console.log(`Partner ${result.name} vat: ${result.vat}`);
            });
        });
    });
});

Running tests

$ npm install
$ npm test

Keywords