New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-inline-source

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-inline-source

Inline flagged js & css sources.

4.0.0
latest
Source
npm
Version published
Weekly downloads
7.1K
-3.24%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-inline-source

NPM Version Build Status Semantic Release Commitizen friendly

Inline all <script>, <link> and <img> tags that contain the inline attribute with inline-source.

How it works

<!-- located at src/html/index.html -->
<html>
  <head>
    <!-- inline src/js/inlineScript.js -->
    <script src="../js/inlineScript.js" inline></script>
  </head>
  <body>
  </body>
</html>
// located at src/js/inlineScript.js

function test() {
  var foo = 'lorem ipsum';
  return foo;
}

Output:

<html>
  <head>
    <script>function test(){var a="lorem ipsum";return a}</script>
  </head>
  <body>
  </body>
</html>

Install

$ npm install gulp-inline-source --save-dev

Usage

var gulp = require('gulp');
var inlinesource = require('gulp-inline-source');

gulp.task('inlinesource', function () {
    return gulp.src('./src/*.html')
        .pipe(inlinesource())
        .pipe(gulp.dest('./out'));
});

Optionally, you can provide some options through an options object:

var gulp = require('gulp');
var inlinesource = require('gulp-inline-source');

gulp.task('inlinesource', function () {
    var options = {
        compress: false
    };

    return gulp.src('./src/*.html')
        .pipe(inlinesource(options))
        .pipe(gulp.dest('./out'));
});

Keywords

gulpplugin

FAQs

Package last updated on 21 Nov 2018

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