Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-file-include

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-file-include

a gulp plugin for file include

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.4K
decreased by-3.85%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

gulp-file-include

a plugin of gulp for file include

install

npm install gulp-file-include

options

  • options - type: string, just as prefix, default @@, and basepath is default @file
fileinclude('@@')
  • options - type: object

    • prefix: string, default @@
    • basepath: string, default @file, it could be @root, @file, your-basepath
  • options.basepath - type: string, it could be

    • '@root', include file relative to the dir where gulp running in
    • '@file', include file relative to the dir where file in
    • 'your-basepath' include file relative to the basepath you give
fileinclude({
  prefix: '@@',
  basepath: '@file'
})
fileinclude({
  prefix: '@@',
  basepath: '/home/'
})

example

index.html

<!DOCTYPE html>
<html>
  <body>
  @@include('./view.html')
  @@include('./var.html', {
    "name": "haoxin",
    "age": 12345
  })
  </body>
</html>

view.html

<h1>view</h1>

var.html

<label>@@name</label>
<label>@@age</label>

gulpfile.js

var gulp = require('gulp'),
  fileinclude = require('gulp-file-include');

gulp.task('fileinclude', function() {
  gulp.src(['index.html'])
    .pipe(fileinclude({
      prefix: '@@',
      basepath: '@file'
    }))
    .pipe(gulp.dest('./'));
});

and the result is:

<!DOCTYPE html>
<html>
  <body>
  <h1>view</h1>
  <label>haoxin</label>
<label>12345</label>
  </body>
</html>

migrate from 0.2.x

  • juse use the options below
{
  prefix: '@@', // or something else
  basepath: '@root'
}

License

MIT

Keywords

FAQs

Package last updated on 16 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc