We've recently published the first alpha version of JSforce 2.0. You can simply access to the latest alpha by following command.
$ npm i -g jsforce@alpha
As already announced, this version has been re-written in TypeScript, which is now becoming the most popular programming language not only for frontend web application developers but for server-side application developers using Node.js.
Of course it has non-official type definitions for JSforce lib in DefinitelyTyped, the natively bundled type definitions are more consistent and sophisticated.
JSforce version 1.9.0 is now released, which includes several enhancements, but the most big one is the enhancement of multi-record CRUD operation.
Even in prior versions you can of course create/retrieve/update/delete multiple records in one call, using SObject#create(records)
, SObject#retrieve(ids)
, SObject#update(records)
, or SObject#destroy(ids)
.
But its internal implementation was a little pity - each of input records were mapped to REST API request and called in parallel.
As a result, this CRUD call eagerly consumed API quota, so it was not suitable to use when the num of records exceeds certain amount.
The connection option maxRequest
parameter (default value is 10) was introduced in order not to make excessive concurrent calls.
Now SalesforceDX has finally become "Open Beta".
There are many features related to improving the "DX", but the most anticipated feature must be "Scratch Org",
which you can create a brand new clean Salesforce organization programatically and instantly.
Thanks to this feature you can reduce the possibility of environment-dependent test errors/successes you might have faced when you reused one organization repeatedly.
JSforce has several features including Salesforce Metadata API access.
So by using JSforce we can create not only a JavaScript application but also a deployment task of Salesforce package.
I previously wrote how JSforce can be used in Salesforce package deployment on Gulp.js, and there are NPM packages called gulp-jsforce-deploy or grunt-jsforce-deploy.
JSforce is useful not only for developing Salesforce application but also for learning Salesforce API itself.
JSforce has a "REPL mode" - you can issue an API request and confirm the result interactively from your terminal console.
The result can be manipulated in JavaScript, so you can even run a simple script in the REPL.
You know there is a well-known web application to check Salesforce APIs casually - Workbench.
This web app does provide interfaces for many APIs of Salesforce, but just for checking the response.
It is not connected to the execution of scripts.