1.0.0 • Published 10 years ago

editorconfig-get-indent v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 years ago

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);
});