0.5.0 • Published 10 years ago

gulp-insert v0.5.0

Weekly downloads
34,486
License
MIT
Repository
github
Last release
10 years ago

gulp-insert

String manipulation library for gulp

Usage

npm install gulp-insert
var insert = require('gulp-insert');

Append

Appends a string onto the contents.

.pipe(insert.append('world')); // Appends 'world' to the contents of every file

Prepend

Prepends a string onto the contents.

.pipe(insert.prepend('Hello')); // Prepends 'Hello' to the contents of every file

Wrap

Wraps the contents with two strings.

.pipe(insert.wrap('Hello', 'World')); // prepends 'hello' and appends 'world' to the contents

Transform

Calls a function with the contents of the file.

.pipe(insert.transform(function(contents, file) {
  return contents.toUpperCase();
}));

Transform has access to the underlying vinyl file. The following code adds a '//' comment with the full file name before the actual content.

.pipe(insert.transform(function(contents, file) {

	var comment = '// local file: ' + file.path + '\n';
	return comment + contents;
}));

See https://github.com/wearefractal/vinyl for docmentation on the 'file' parameter.

ldu-gulpfunctionsxx-lrzmagnoabsass-sdfddabc-jdjdjjdtempaw-toolszemez-buildsup-tween.jszoos-mp-servicetestmagno@infinitebrahmanuniverse/nolb-gulp-igulp-ng2-template-wrap-amber@everything-registry/sub-chunk-1808syy-mp-servicesystemjs-route-bundlerwix-lucy-clixipcodews-voice-infinity-global-modulews-react-base-dictionaryws-react-global-modulews-react-modal-dialogws-intranet-global-modulews-react-tabletempaw-buildtempaw-functionstempaw-functions-zemeztempaw-zemez-functionsspeck-buildspoonx-toolstest-weuisuperhao-lrzitbjenkins-react-js-builderlaravel-elixir-angular-templatecacheima-gulp-tasksima.js-gulp-tasksiamreservationsguh-coregulp-librarygulp-pbuildgulp-quickbasegulp-feo-tasksgulp-angular-inline-templategulp-config-docomo-digitalgulp-dev-toolsgulp-enb-commentgulp-github-changeloggulp-helpersgulp-j2hrzgulp-siblinggulp-shenanigansgulp-ng2-template-wrapgulp-utensiliinstruqt-cliinteractives-starterkitlitchi-mp-serviceliferay-theme-taskslrzlrz-lcylrz-lwlrz-modlrz_zzclucify-build-toolsmarketplace-gulplorrylmr-brandplatformlucy-clilabkey-mobilelanders.gulp-helperlambda_patternmetal-ssg@thewhite/react-geo@thewhite/react-global-module@thewhite/react-modal-dialog@thewhite/react-table@zhuxian/miniprogramagilzorroallons-y-md5angulparastore-gulpassembler-cli1000-packages@egis/build-tools@alkemyecommerce/gulp-made-easy@amocrm/stylesstyle-onespringbokjs-shimspringbokjs-basespringbokjs-base-nextsuh-dgeni-ngdocstrainmantidy-bowtie@cheststore/clizengslrzwazoo-frameworkzmi-nerd@loreena/gulp-made-easy@jysd/lrz@qbyco/tjs-cli
0.5.0

10 years ago

0.4.0

11 years ago

0.3.0

12 years ago

0.2.0

12 years ago

0.1.0

12 years ago