editorconfig-get-indent

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i editorconfig-get-indent

Weekly Downloads

5

Version

1.0.0

License

ISC

Last publish

Collaborators

  • andrewdeandrade