2.0.0 • Published 6 years ago

pengines v2.0.0

Weekly downloads
-
License
BSD-2-Clause
Repository
-
Last release
6 years ago

Pengines

Pengines is short for Prolog Engines. The pengines package greatly simplifies developing JavaScript based web-applications that must talk to a Prolog server and realise distributed programming in Prolog by providing RPC over HTTP.

The JavaScript API

The Pengines JavaScript API allows a web application developer to create a pengine object like so:

var pengine = new Pengine(options);

options is a JavaScript object contaning zero or more of

A pengine object also provides access to the following fields and methods.

Examples

Please refer to documentation at here for working examples.

The Prolog API

The Prolog API is documented in the following document: Prolog API.

Usage in Node.js

Install using NPM: npm install pengines and use:

var Pengine = require('pengines');
var pengine = new Pengine();

and follow the JavaScript API description above.

Testing

To test the Pengines JavaScript API, you need to install required testing dependencies using the npm install command in the project root directory.

Then load test_js.pl in SWI-Prolog:

-? [test_js].

and run tests using run_tests.

License

Pengines is licensed under the BSD 2-Clause license. See the header of web/js/pengines.js file.