Socket
Socket
Sign inDemoInstall

strip-whitespace-loader

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    strip-whitespace-loader

Strip whitespace from strings in javascript assets


Version published
Weekly downloads
560
increased by4.48%
Maintainers
1
Install size
36.0 MB
Created
Weekly downloads
 

Readme

Source

strip-whitespace-loader

node Travis AppVeyor Known Vulnerabilities David Greenkeeper badge Coveralls Codacy grade

Strip-Whitespace-Loader is a loader for webpack that will remove extraneous spaces from strings. It's perfect for working with rendering templates (ex. mustache, handlebars) or es6 javascript templates. It works with anything where you might create very long strings.

Before strip-whitespace-loader:
function() {
  if (condition) {
    const longString = '  String   with    some    extra   spaces  ';
  }
}
After strip-whitespace-loader:
function() {
  if (condition) {
    const longString = ' String with some extra spaces ';
  }
}
Webpack usage
{
  module: {
    rules:[
      {
        test: /\.js$/,
        loader: [ 'strip-whitespace-loader', 'babel-loader' ]
      },
      {
        test: /\.tsx?$/,
        loader: [ 'strip-whitespace-loader', 'ts-loader' ]
      }
    ]
  }
}

Keywords

FAQs

Last updated on 09 Jan 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc