Get root folders of git, svn, mercurial, nodejs node_modules / package.json / package-lock.json, and nodejs .jscache folder
Find the demos in the demos folder
var getroot = require("get-root");
let result = getroot.getRoot("./", { baseType: "git" });
Usage: getRoot(startdirectory, options = { baseType: "git", getRootCallback: callbackFunction })
Get the root folder of specified options.
/**
*
* @param {*} startdirectory
* @param {string} [options={ baseType: "git", getRootCallback: callbackFunction }]
* @return {*}
*/
Usage: getNodeModulesRoot(startdirectory, options)
Get the root folder of node in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Usage: getGitRoot(startdirectory, options)
Get the root folder of git in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Usage: getSvnRoot(startdirectory, options)
Get the root folder of svn in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Usage: getMercurialRoot(startdirectory, options)
Get the root folder of mercurial in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*
*/
Usage: getPackageJsonRoot(startdirectory, options)
Get the root folder of package.json in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Usage: getPackageLockJsonRoot(startdirectory, options)
Get the root folder of package.json in the project.
/**
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Usage: getJscachePath(startdirectory, options)
Get the root folder of jscache in the project.
/**
*
*
* @param {*} startdirectory
* @param {*} options
* @return {*}
*/
Contributions, Feature Improvements, Bugs, and Issues are invited. raising an issue