New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-pragma

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-pragma

A Gulp plugin to optionally remove pragma comments from your code that follow a particular pattern. Useful for JavaScript builds.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Gulp Pragma

A Gulp plugin to optionally remove pragma comments from your code that follow a particular pattern. Useful for JavaScript builds.

Installation   npm version NPM downloads

npm install gulp-pragma

Simple Usage

Pass a simple config object to pragma() in your Gulp pipe. All the properties of the objects represent pragma tags. Set to false to remove them. Use all if you want to just remove all pragma blocks.

The system will look for sections of code that have this signature:

// To remove this section use: pragma({ debug: false })
/* pragma:DEBUG_START */
var a = true;
console.warn("a is", a);
/* pragma:DEBUG_END */

// To remove this section use: pragma({ amd: false })
/* pragma:AMD_START */
var a = true;
console.warn("a is", a);
/* pragma:AMD_END */

Use in your gulpfile:

var pragma = require('gulp-pragma');
gulp.src(['/**/*.js'])
.pipe(pragma({
    debug: false,
    amd: false
  }));

To remove all pragma blocks:

gulp.src(['/**/*.js'])
.pipe(pragma({
    all: false
  }));

Note: Its recommended you run this on your concatenated stream rather than your split-up file stream for performance reasons.

Keywords

FAQs

Package last updated on 06 Mar 2016

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc