0.3.1 • Published 5 years ago

grunt-cache-manage v0.3.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

grunt-cache-manage

npm version Build Status

Generate a file which manages file's versions.

Getting Started

This plugin requires Grunt >=1.0.0

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-cache-manage --save-dev

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

grunt.loadNpmTasks('grunt-cache-manage');

The "cache_manage" task

Overview

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

grunt.initConfig({
  cache_manage: {
    main: {
      options: {
        algorithm: 'md5',
        encoding: 'utf8'
      },
      files: {
        'samplemainjs': 'sample-main.js'
      },
      template: 'sample-mustache-template.txt',   // mustache template file.
      dest: 'sample-dest.txt'                     // output file.
    }
  }
});

Options

options.algorithm

Type: String Default value: 'md5'

options.encoding

Type: String Default value: 'utf8'

Usage Examples

Default Options

grunt.initConfig({
  cache_manage: {
    options: {},
    files: {
      'key_name': 'path/to/file',
    },
    template: 'path/to/template/file',
    dest: 'path/to/dest/file'
  }
});

Custom Options

grunt.initConfig({
  cache_manage: {
    options: {
      algorithm: 'sha1',
      encoding: 'utf16le',
    },
    files: {
     'key_name': 'path/to/file',
    },
    template: 'path/to/template/file',
    dest: 'path/to/dest/file'
  }
});

Release History

dateversiondescription
2018-10-11v0.3.0Fix dependencies vulnerabilities ( #5 )
2018-04-28v0.2.0Updated dependencies. ( #4 )
2018-01-26v0.1.3Print error detail when failed hashing. ( #2 )
2014-10-30v0.1.0First release.
0.3.1

5 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

8 years ago

0.1.1

9 years ago

0.1.0

10 years ago