Grunt-Task, fetches the latest browscap.ini file from browscap.org and deploys it to a local directory.
This plugin requires Grunt >=0.4.5
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 --save-dev grunt-fetch-browscap
Once the plugin has been installed, it may be enabled inside your Gruntfile:
grunt.loadNpmTasks('grunt-fetch-browscap');
Run this task with the grunt fetch-browscap
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
In your project's Grundfile, add a section named fetch-browscap
to the data
object passed into grunt.initConfig()
.
grunt.initConfig({
"fetch-browscap": {
your_target : {
options: {
destination: "target/browscap.ini",
version: "Lite_PHP_BrowsCapINI",
versionNumberDestination: "build/browscap.version"
}
}
}
});
Type: String
Default value: target/browscap.ini
The destination where the file will be downloaded to.
Type: String
Default value: Lite_PHP_BrowsCapINI
The type of browscap.ini-file you are interested in. Supported values are:
BrowsCapINI
: This is the standard version of browscap.ini file for IIS 5.x and greater.Full_BrowsCapINI
: This is a larger version of browscap.ini with all the new properties.Lite_BrowsCapINI
: This is a smaller version of browscap.ini file containing major browsers & search engines. This file is adequate for most websites.PHP_BrowsCapINI
: This is a special version of browscap.ini for PHP users only!Full_PHP_BrowsCapINI
: This is a larger version of php_browscap.ini with all the new properties.Lite_PHP_BrowsCapINI
: This is a smaller version of php_browscap.ini file containing major browsers & search engines. This file is adequate for most websites.BrowsCapXML
: This is the standard version of browscap.ini file in XML format.BrowsCapCSV
: This is an industry-standard comma-separated-values version of browscap.ini. Easily imported into Access, Excel, MySQL & others.BrowsCapJSON
: This is a JSON (JavaScript Object Notation) version of browscap.ini. This is usually used with JavaScript.BrowsCapZIP
: This archive combines all the above files into one download that is smaller than all eight files put together.
Type: String
Default value: target/browscap.version
Refers to a filename that caches the downloaded version. Its contents are compared against browscap.org/version-number to determine if a file is to be downloaded.
Be aware that downloading the INI files from browscap.org implies agreeing to their fair usage policy. Repeat downloads may lead to temporary or permanent bans.
- 2015-12-17 v0.2.0: caches the version-number
- 2015-12-17 v0.1.1: documentation fix
- 2015-12-17 v0.1.0: initial version, not intended for public release