JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q17769F
  • License MIT

Javascript Node.js bindings library for the Amatino API - Double entry accounting as a service

Package Exports

  • amatino

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (amatino) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Amatino JS

Amatino is a double-entry accounting system. It provides double entry accounting as a service via an HTTP API. Amatino JS is a library for interacting with the Amatino API from within a Node.js application. By using Amatino JS, a Node.js developer can utilise Amatino services without needing to deal with raw HTTP requests.

About Amatino

Amatino gives you a full set of tools to store, organise and retrieve financial information. You don't need to set up databases or write any of your own double-entry accounting logic. All you need is this library, an Amatino account (Try free for two weeks!), and you are off and running.

Under construction

Right now, the Amatino API offers a full range of accounting services via HTTP requests. However, this Amatino JS library is in an 'Alpha' state. Its capabilities are limited. One class is available: AmatinoAlpha.

AmatinoAlpha is a thin wrapper around asynchronous HTTP requests to the Amatino API. It facilitates testing and experimentation with the Amatino API without having to resort to raw HTTP request manipulation and HMAC computation.

Amatino JS will eventually offer expressive, object-oriented interfaces for all Amatino API services. To be notified when Amatino JS enters a Beta state, with all capabilities available, sign up to the Amatino Development Newsletter.

In the mean time, you may wish to review Amatino's HTTP documentation to see what capabilities you can expect from Amatino JS in the future.

Installation

Amatino JS may be installed via NPM.

$ npm install amatino

To use Amatino JS, you will need an active Amatino subscription. You can start a free trial at https://amatino.io/subscribe.

Example Usage

The AmatinoAlpha object allows you to use the Amatino API without dealing with raw HTTP requests or HMACs. It lacks the expressive syntax, input validation, and error handling that Amatino JS will have in the beta stage.

Initialise an AmatinoAlpha instance like so:

const Amatino = require('amatino');

let _ = Amatino.AmatinoAlpha.createWithEmail(
  'clever@cookie.com',
  'high entropy passphrase',
  (error, amatinoAlpha) => {
    // Do stuff with amatinoAlpha
  }
);

Request may then be made like so:

let _ = amatinoAlpha.request(
  '/entities',
  'POST',
  null,
  [{
    'name': 'My First Entity',
    'description': null,
    'region_id': null
  }],
  (error, responseData) => {
    const newEntity = responseData[0];
    // Do stuff with newEntity
  }
);

Wherein the parameters passed to request() are the HTTP path, method, url parameters ('query string'), and body laid out in the Amatino API HTTP documentation.

For example, the above request created an Entity. The requirements for Entity creation are available at https://amatino.io/documentation/entities#action-Create.

For more examples of AmatinoAlpha usage, see the getting started guide.

Running tests

Amatino JS features a unit test suite. You can execute the test suite like so:

$ npm test

The test suite requires the presence of two environment variables: AMATINO_TEST_EMAIL and AMATINO_TEST_SECRET. These variables must be populated with the email address and passphrase of an Amatino user account with a valid subscription. For example:

$ export AMATINO_TEST_EMAIL=clever@cookie.com
$ export AMATINO_TEST_SECRET="some high entropy passphrase"

JavaScript API stability & versioning

Amatino JS obeys the Semantic Version convention. Until v1.0.0, the JavaSript API should be considered unstable and liable to change at any time.

Watch out! API currently unstable!

You can see available versions in GitHub's releases section or under NPM's 'Versions' heading.

Tell us what your think/want/like/hate

Please join us on the Amatino discussion forums and give us your feedback. We would love to hear from you. Amatino is in its earliest stages of development, and your feedback will influence the direction it moves in.

Pull requests, comments, issues, forking, and so on are also most welcome on Github!

Get in contact

To quickly speak to a human about Amatino, email hugh@amatino.io or yell at him on Twitter (@hugh_jeremy).