Recently I have been discussing my usual webpack-centric workflow with a colleague. He pointed that I use both webpack and powershell, he suggested that I should try to get rid of powershell and work on Mac or Linux (sick bastard!). In theory I can use VS Code on any platform, but I will stay on Windows for now. In any case, I decided that it is a good idea to replace some of my powershell code with nodejs scripts. I have tried to find an auth lib for SharePoint Online with no luck.

There are lots of good libs for the app-authentication, and ADAL.js is awesome. But I wanted to use login/password approach to use it from console. I tried to find a nodejs script that can upload some files to SharePoint 'Style Library' or any other document library. After searching for awhile I didn't find anything that can cover my needs. I found a few old abandoned implementations of client API interfaces to SharePoint REST services, but most of them were broken. Microsoft is constantly changing an authentication piece of Office365, so most of those libs are obsolete now. Unfortunately they are still listed on NPM. That's why I decided to roll out a new NPM module.

I found an awesome article about SharePoint Online remote authentication (and Doc upload) from Paul Ryan. It has everything you need to build an auth module for SPO in any language.

Also, I used this tutorial about publishing an NPM module, .gitignore for Node.

I like to play with console, but unfortunately it's not possible to create a github repository from console, so I created it manually.