editorconfig-indent

0.3.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i editorconfig-indent

Weekly Downloads

59

Version

0.3.0

License

MIT

Last publish

Collaborators

  • morishitter