Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 878 Bytes

readme.md

File metadata and controls

55 lines (42 loc) · 878 Bytes

editorconfig-indent Build Status

get indent_size and indent_style from .editorconfig file

Installation

$ npm install editorconfig-indent

Usage

var fs = require('fs')
var getIndent = require('editorconfig-indent')
var editorconfig = fs.readFileSync('.editorconfig', 'utf-8')

getIndent(editorconfig)

/*
{
    indentSize: {
        all: 4
    },
    indentStyle: {
        all: 'space'
    }
}
*/


/* specify the file extension */
getIndent(editorconfig, ['css', 'scss'])

/*
{
    indentSize: {
        all: 4,
        css: 2,
        scss: null
    },
    indentStyle: {
        all: 'space',
        css: null,
        scss: null
    }
}
*/

License

The MIT License (MIT)

Copyright (c) 2015 Masaaki Morishita