SharePoint-apponly-node
access SharePoint using client credentials "apponly" from nodejs applications
run npm install sharepoint-apponly-node --save
- Require the sharepoint-apponly module
var sharepoint=require('sharepoint-apponly-node');
- Execute call to getSharePointAppOnlyAccessToken and get the token response body in the callback
sharepoint.getSharePointAppOnlyAccessToken('https://yoursubdomain.sharepoint.com', 'YourClientId','YourClientSecret',function(response){ console.log(response); });
the result will be something like