editorconfig-get-indent
Given a path on a filesystem, crawl the parent directories, looking for the first ancestor that contains an .editorconfig file. Once that file is found, parse it and determine the indentation for a file extension (default: 'js');
Usage
var editorConfigGetIndent = require('editorconfig-get-indent');
var options = {
defaultIndent: 2,
extension: 'js'
};
editorConfigGetIndent(__dirname, options, function onIndent(err, indent) {
if (err) {
return console.error(err);
}
console.log(indent);
});