codedent

0.1.2 • Public • Published

codedent

build status Coverage Status

Usable both as template literal tag or just as callback for strings, removes all spaces found at the very first line of code encountered while sanitizing, keeping everything else around.

import dedent from 'codedent';

dedent`
  def this_is_fine():
    return "fine"
`;

/**
def this_is_fine():
  return "fine"
*/

Differently from dedent module, this one doesn't care about code starting in one line then indented in others ... it's just code as you pass it along, no magic involved.

Readme

Keywords

Package Sidebar

Install

npm i codedent

Weekly Downloads

67

Version

0.1.2

License

ISC

Unpacked Size

5.87 kB

Total Files

7

Last publish

Collaborators

  • webreflection