Skip to content

Plugin to strip banner comments that match a particular form from all Javascript files in a directory tree.

License

Notifications You must be signed in to change notification settings

kaazing/grunt-stripbanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-stripbanner

Build Status

Plugin to strip banner comments that match a particular form from all Javascript files in a directory tree.

Getting Started

This plugin requires Grunt.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-stripbanner --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-stripbanner');

The "stripbanner" task

Overview

In your project's Gruntfile, add a section named stripbanner to the data object passed into grunt.initConfig().

grunt.initConfig({
  stripbanner: {
    options: {
      cwd: '.',
      content: 'Copyright (c)'
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.cwd

Type: String Default value: '.'

A string value that is used as the root directory under which Javascript files will be processed

options.content

Type: String Default value: 'Copyright (c)'

A string value that is used as the content to look for in C-style (/* */) comments. Any comment that contains the content string will be stripped from the source file.

Usage options

stripbanner: { tmpFiles: { options: { cwd: 'dist/tmp' } } }

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

License

Copyright (c) 2014 Kaazing Corporation. Licensed under the Apache 2.0 license.

About

Plugin to strip banner comments that match a particular form from all Javascript files in a directory tree.

Resources

License

Stars

Watchers

Forks

Packages