Socket
Socket
Sign inDemoInstall

infinite-loop-loader

Package Overview
Dependencies
4
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    infinite-loop-loader

A webpack loader to transform ∞ loops so that they throw


Version published
Weekly downloads
634
increased by7.64%
Maintainers
5
Install size
1.23 MB
Created
Weekly downloads
 

Readme

Source

infinite-loop-loader

A webpack 2 loader to transform ∞ loops so that they throw

Before:

while(true){
  // your logic here
}

After:

var __ITER = 1000000000;
while(true) {
  if (__ITER <= 0) {
    throw new Error("Loop exceeded maximum allowed iterations");
  }
  // your logic here
  __ITER--;
}

Installation

npm install --save-dev infinite-loop-loader

Usage

Webpack config example

...
module: {
      rules: [
        {
          test: /\.js$/,
          use: [
            loader: 'infinite-loop-loader',
            options: {
              // iteration limit
              limit: 10000,
              // falafel -> acorn options
              opts {
                allowImportExportEverywhere: true
              }
            }
          ]
        }
      ],
      ...
    }
...

Keywords

FAQs

Last updated on 26 Oct 2021

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