grunt-snippet 0.1.0

Grunt task plugin to inject code pieces into your index.html build file

Homepage: https://github.com/stevermeister/grunt-snippet

Platform: npm

Language: JavaScript

License: MIT

View on registry: https://www.npmjs.com/package/grunt-snippet/

Install: npm install grunt-snippet


grunt-snippet

Grunt task plugin to inject code pieces into your index.html build file

Getting Started

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 grunt-snippet --save-dev

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

grunt.loadNpmTasks('grunt-snippet');

The "snippet" task

Overview

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

grunt.initConfig({
 snippet: {
 options: {
 // Task-specific options go here.
 },
 your_target: {
 // Target-specific file lists and/or options go here.
 },
 },
});

Options

options.separator

Type: String Default value: ', '

A string value that is used to do something with whatever.

options.punctuation

Type: String Default value: '.'

A string value that is used to do something else with whatever else.

Usage Examples

Default Options

In this example, the default options are used to do something with whatever. So if the testing file has the content Testing and the 123 file had the content 1 2 3, the generated result would be Testing, 1 2 3.

grunt.initConfig({
 snippet: {
 options: {},
 files: {
 'dest/default_options': ['src/testing', 'src/123'],
 },
 },
});

Custom Options

In this example, custom options are used to do something else with whatever else. So if the testing file has the content Testing and the 123 file had the content 1 2 3, the generated result in this case would be Testing: 1 2 3 !!!

grunt.initConfig({
 snippet: {
 options: {
 separator: ': ',
 punctuation: ' !!!',
 },
 files: {
 'dest/default_options': ['src/testing', 'src/123'],
 },
 },
});

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)

веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей

Development Dependencies


GitHub Repository

stevermeister/grunt-snippet stevermeister/grunt-snippet

Grunt task plugin to inject code pieces into your build

Language: JavaScript

Created: April 01, 2015 12:39

Last updated: April 01, 2015 12:59

Last pushed: April 01, 2015 12:58

Size: 0 Bytes

Stars: 0

Forks: 0

Watchers: 1

Open issues: 0

Top Contributors

Stepan Suvorov

Releases

  • 0.1.0 - April 01, 2015 12:56

Related Projects

grunt-wingdingify 0.0.2
A grunt plugin to wingdingify your javascript source code
npm - JavaScript - MIT - Updated 7 months ago - 2 stars
chop-grunt-php-builder 0.1.0
Grunt plugin to statically build PHP files
npm - JavaScript - MIT - Published almost 2 years ago
cn-version 0.1.1
Inject version number into build files for cache-busting and version-specific code.
npm - JavaScript - MIT - Updated 4 months ago
grunt-dojo 1.0.1
Build Dojo inside a Grunt task
npm - JavaScript - MIT - Updated 3 months ago - 28 stars
grunt-file-generator 0.1.0
Grunt task for file generation
npm - JavaScript - MIT - Published 9 months ago
веселые картинки развлекательные гифки интресные факты смешные видео смешные истории из соцсетей