Package Exports
- fms-js
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 (fms-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fms-js
node and browser connection for FileMaker Server
Status: 2 - unstable
The api is under development and may change. Backwards compatibility will be maintained if feasible. See node stability ratings
Installation
fms-js can be installed using npm
npm install fms-js
Usage
Once installed you can require the fms object, and start to use it
var fms = require('fms-js);
// create a connection object
var connection = fms.connection({
url : '<url>',
userName : 'username',
password : 'password
});
//use the connection object to create requests
var listDBNamesRequest = connection.dbnames();
//and send it to FileMaker Server
//all request are asynchronous.
//Pass the callback to the 'send()' method
listDBNamesRequest.send(callback)
The API is chainable. So you can do some fun expressive things. The following will find the first 10 contacts who have the firstName 'todd"
connection
.db('Contacts')
.layout('contacts')
.find({
'firstName' : 'todd'
})
.set('-max', 10)
.send(callback)
You can keep a reference to any point in the chain. So this is the equivilent of the above
var db = connection.db('Contacts');
var layout = db.layout('contacts');
var findRequest = layout.find({
'firstName' : 'todd'
})
var findRequestFirstTen = findRequest.set('-max', 10)
findRequestFirstTen.send(callback)