unindent
Remove indentations from a block of code
Last updated 5 years ago by elliottcable .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install unindent 
SYNC missed versions from official npm registry.

unindent

Remove indentations from a block of code

Installation

npm install unindent

Example

var assert = require('assert');
var unindent = require('unindent');
var code = '\ta\t\tb';

assert.equal(unindent(code), 'a\tb');

API

unindent(code, [opts]);
  • code - A string of code.
  • opts - An optional object literal support these options:
    • tabSize - Number. If specified, the starting tabs of each line will be convert to spaces.
    • trim - Boolean. Whether the unindented code should be trimed.

Current Tags

  • 2.0.0                                ...           latest (5 years ago)

4 Versions

  • 2.0.0                                ...           5 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 9
This Month 15
Last Day 0
Last Week 6
Last Month 31
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |