New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

remove-tabs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remove-tabs

Remove tabs which are added between multi-line template strings by using tagged

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

remove-tabs

Build Status Npm Version Node Version Npm License

Remove tabs which are added between multi-line template strings by using tagged

Install

nodejs

npm install remove-tabs --save
//app.js
const r = require('remove-tabs');
...

browser

<script src="path/to/bower_components/remove-tabs/remove-tabs.js"></script>
<script>
	var r = window['removeTabs'];
	...
</script>

amd

//main.js
require.config({
	...
	paths: {
		...
		'removeTabs': 'path/to/bower_components/remove-tabs/remove-tabs'
	}
});
//app.js
define(['removeTabs'], function(r) {
	...
});

Compability

  • Compability depends on whether supports "template string" or not
  • IE edge(12+), nodejs(4+), firefox(34+), chrome(41+), Safari(9+), iOS(9+)

More Detail

Usage

Added tabs are annoying when multi-line template strings.

var a = `These
		are annoying!!!`;
		
console.log(a); // 'These\n\t\tare annoying!!!'

So I use tagged function to remove them.
It checks first line's tab number and removes other lines's tabs according to it.

var a = 
r`		Not
		annoyed any more :)`;

console.log(a); // 'Not\nannoyed any more :)'

If you don't like leading tagged, top-tagged is also allowed.

var a = r`
		Not
		annoyed any more too! :)`;

console.log(a); // 'Not\nannoyed any more too! :)'

License

MIT

Keywords

template

FAQs

Package last updated on 23 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts