author : Alex Chao Nov 7th, 2019. Modularized
 *  function param returns changelog import * as vscode from 'vscode' ; const path = require ( 'path' ) ; const fs = require ( 'fs' ) ; function findRootDirectory ( ) { let root = path . dirname ( vscode . window . activeTextEditor ! . document . fileName ) ; while ( ! fs . existsSync ( `${ root }/package.json` ) ) { root = path . dirname ( root ) ; } return root ; } module . exports = findRootDirectory ;