This library is at early alpha stage, don't expect it to do much. If you are using NodeJS and struggling to get data from NetSuite's SOAP based SuiteTalk API then looking through the code may prove informative.
npm install netsuite-v2017.2
With credentials:
var NetSuite = require('netsuite-v2017.2');
var ns = new NetSuite({appId: 'AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA', passport: {account: 'TSTDRV111111', email: 'you@yourcompany.com', password: 'shhhhh'}});
Here's a quick example that will loop through all files in your account:
var NetSuite = require('netsuite-v2017.2');
var ns = new NetSuite({appId: 'AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA', passport: {account: 'TSTDRV111111', email: 'you@yourcompany.com', password: 'shhhhh'}});
var result = await ns.search({type: 'FileSearch'});
while (result) {
result = await ns.searchMoreWithId(result);
}
- FolderSearch
- FileSearch
var NetSuite = require('netsuite-v2017.2');
var ns = new NetSuite({appId: 'AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA', passport: {account: 'TSTDRV111111', email: 'you@yourcompany.com', password: 'shhhhh'}});
var result = await ns.get({type: 'file', internalId: '88'});
var b64Content = result.readResponse.record.content;
To run unit tests, execute npm test
This NetSuite SOAP client is distributed under the MIT licence.