Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.
/ grunt-freeport Public archive

🆓 Grunt task to get a free port number on localhost from specified range

Notifications You must be signed in to change notification settings

deepsweet/grunt-freeport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-freeport

npm travis climate deps gratipay

Grunt task to get a free port number on localhost from specified range. Uses node-portscanner.

Install

$ npm i -S grunt-freeport

Usage

grunt.initConfig({
    freeport: {
        sometask: {
            options: {
                start: 8080,
                end: 8089
            }
        }
    },
    sometask: {
        options: {
            port: '<%= freeport.sometask %>'
        }
    }
});

// common, start using `load-grunt-tasks`
grunt.loadNpmTasks('grunt-freeport');

grunt.registerTask('default', [ 'freeport:sometask', 'sometask' ]);

Options

  • start – start point to find a free port, must be >= 1, 1 by default
  • end – end point to find a free port, must be <= 65535, 65535 by default

If task target is omitted then it will use default variable name freeport, i.e. you should use '<%= freeport %>'.

License

WTFPL

About

🆓 Grunt task to get a free port number on localhost from specified range

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published