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-templatecachestyle-onespringbokjs-shimspringbokjs-basespringbokjs-base-nextsuh-dgeni-ngdocstrainmantidy-bowtie@amocrm/styles@assassin567/cut-file@alkemyecommerce/gulp-made-easy@cheststore/cli1000-packageszengslrzwazoo-frameworkzmi-nerd@egis/build-tools@evan.network/angular-gulp@frontvue/plugin-stylus@gilt-tech/swig-lint@loreena/gulp-made-easy@marknotton/gulp-tasks@jysd/lrz@ima/gulp-tasks@qbyco/tjs-cli@prowebtec/opexdk@polkas/my-component@nurun-sf/spark-style-guide@spectrum-css/build@spectrum-css/component-builder@romger/react-geo@romger/react-global-module@romger/react-modal-dialog@romger/react-tablemvcct-templatesmpgenericmobi-util-build-cssmod-sitemlv1oxyz-buildnresourcepbiviz-clipaviosseeds-docsrn-toolsprokure_blueprintreinform-scripts-apprun-thingsenogulpreact-nexus-chatngr-rba-libsngr-rba-sourceplumespip-webui-taskspomypsi-gulpslurpeeslush-atomslush-bemslush-zeesistemium-gulpslush-metaslush-moleculeslush-springrollsite-mastersoftcookiesgov-lrz-fix
0.5.0

10 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago