untab

1.0.1 • Public • Published

untab

remove leading whitespace in template strings

Install

npm install --save untab

Usage

const u = require('untab');
 
function renderHtml(res, model){
  res.write(untab`
    <!doctype html>
    <html>
      <head>
        <title>${model.title}</title>
      </head>
      <body>
        <h1>${model.title}</h1>
      </body>
    </html>
  `);
}
 

Description

untab will remove the leading whitespace characters from a template string. It will look at the first line and remove as many leading whitespace characters as that line has. This preserves the indentation on the following lines.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i untab

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mariusgundersen