editorconfig-get-indent
Given a path, find .editorconfig and get the indent for JavaScript files
Last updated 12 years ago by malandrew .
ISC · Original npm · Tarball · package.json
$ npm install editorconfig-get-indent 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (12 years ago)

1 Versions

  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 0
Dependencies (2)
Dev Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE