Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
gulp-defeatureify
Advanced tools
Remove specially flagged feature blocks and debug statements from Javascript using defeatureify [Experimental]
Remove specially flagged feature blocks and debug statements from JavaScript as part of your Gulp build process
Package | gulp-defeatureify |
Node Version | >= 0.9.0 |
Gulp Version | 3.x |
defeatureify
is used in the ember-dev
package to enable or remove features and strip debug statements during the Ember.js build process.
This simple plugin exposes defeatureify
as a Gulp plugin so you can use this same process in your own project. (Your project does not need to be an Ember.js application in order to use this plugin.)
npm install gulp-defeatureify --save-dev
options.enableStripDebug
Type: Boolean
Default: false
Enables stripping the debug statements specified in options.debugStatements
.
options.debugStatements
Type: Array
Default: []
An array of strings containing debug statements to remove. Does not use options.namespace
.
Example:
debugStatements: ['App.debugMessage']
options.emberDebugStatements
Type: Boolean
Default: false
Adds the following default Ember debug statements to options.debugStatements
:
debugStatements: [
'Ember.warn',
'Ember.assert',
'Ember.deprecate',
'Ember.debug',
'Ember.Logger.info'
]
options.features
Type: Object
Default: {}
An object containing feature names to enable or disable. Features with a value true
will be enabled, otherwise they will be removed from the source.
Example:
features: {
'some-cool-feature': true,
'ember-metal-run-bind': true,
'with-controller': true,
'query-params-new': false,
'string-humanize': false
}
options.namespace
Type: String
Default: 'Ember'
The namespace to look for the features in.
var defeatureify = require('gulp-defeatureify');
var statements = ["Ember.warn", "Ember.assert", "Ember.deprecate", "Ember.debug", "Ember.Logger.info"];
gulp.task('scripts', function() {
gulp.src(['./app/*.js')
.pipe(defeatureify({
debugStatements: statements,
enableStripDebug: true
}))
.pipe(gulp.dest('./dist/'))
});
In this example, various Ember
debug statements are configured to be stripped from the source file:
App.IndexRoute = Ember.Route.extend({
model: function() {
Ember.warn('This is a debug statement that will be removed by defeatureify');
return ['red', 'yellow', 'blue'];
}
});
The generated result will be:
App.IndexRoute = Ember.Route.extend({
model: function() {
return ['red', 'yellow', 'blue'];
}
});
grunt-ember-defeatureify by @craigteegarden
Thanks to Craig for documenting defeatureify
as part of his grunt task. This README is largely his work.
The MIT License (MIT)
Copyright (c) 2014 Jason Sandmeyer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Remove specially flagged feature blocks and debug statements from Javascript using defeatureify [Experimental]
The npm package gulp-defeatureify receives a total of 0 weekly downloads. As such, gulp-defeatureify popularity was classified as not popular.
We found that gulp-defeatureify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.