SuiteScript 2.1 Capabilities
The following capabilities are available when you use SuiteScript 2.1:
Map/Reduce Script Type
With SuiteScript 2.1, you can use map/reduce scripts to process large numbers of records on the server. Map/reduce scripts give you a structured way to process lots of records on the server. If you're a SuiteCloud Plus user, you can even process records in parallel across multiple processors, and you get to choose how many processors to use right from the script deployment record.
For more information, see SuiteScript 2.1 Map/Reduce Script Type.
Asynchronous Processing with Promises
Promises are JavaScript objects that represent the result of an asynchronous process. After you create a promise, it acts as a placeholder for whether an operation will succeed or fail. As a promise waits in the background, the rest of your script can keep running.
In SuiteScript 2.1, promises let you write asynchronous code that's both intuitive and efficient. All client scripts support promises, and server scripts support them for selected modules. You can use SuiteScript 2.1 promise APIs when available, or create custom promises in client scripts.
For more information, see Promise Object.
SFTP File Transfer API
SuiteScript 2.1 supports SFTP (Secure File Transfer Protocol), so you can securely transfer files between NetSuite and external FTP servers. SFTP is packaged with SSH and works like FTP, but with a secure connection. To authorize the server, you'll need a password GUID (Globally Unique Identifier) and either of the following:
-
DSA (Digital Signature Algorithm
-
ECDSA (Elliptical Curve Digital Signature Algorithm)
-
RSA (cryptosystem) host key
For more information, see N/sftp Module.
Cache API
The SuiteScript 2.1 Cache API lets you load data into a cache and share it with one or more scripts. This feature helps cut down the time it takes to retrieve data.
For more information, see N/cache Module.
Search Pagination API
The SuiteScript 2.1 Search Pagination API lets you page through search results. This makes scripts run faster and gives you an efficient way to work with large sets of search data.
For more information, see N/search Module.
Flat File Streaming API
With SuiteScript 1.0, it's challenging to access files larger than 10MB. You'd have to split big files into smaller ones to read, write, or append their contents in memory.
The SuiteScript 2.1 Flat File Streaming API lets you efficiently process and stream large CSV and plain text files. You can load and edit each line in memory, then place the lines back together. The 10MB limit now only applies to individual lines, not the whole file.
For more information, see N/file Module.
HTTP Content Type Header Support
SuiteScript 2.1 supports all HTTP content types, for both client requests and server response headers.
For more information, see N/http Module and N/https Module.
Encryption and Encoding Functionality
SuiteScript 2.1 includes APIs for hashing, HMAC, symmetric encryption, and string encoding conversion. Use these APIs to encrypt data, create or verify hashes or HMACs, and convert strings between supported encodings.
For more information, see N/crypto Module and N/encode Module.