npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-angular4-embedfromurl

v1.0.1

Published

Embed html and css templates in angular components

Readme

gulp-angular4-embedfromurl


This package is a Gulpjs plugin to embed html and css references in any Angualr >4.x component. If there are templateUrl: './header.template.html' or styleUrls: ['./header.style.css'] links, gulp-angular4-embedfromurl will replace this links by the links content.

Install


 $ npm install --save-dev gulp-angular4-embedfromurl

How to use


This in only an example. Its possible to combine gulp-angular4-embedfromurl with any other gulpjs pluigns.

 var gulp = require('gulp');
 var angularEmbed = require("gulp-angular4-embedfromurl");
 var uglify = require('gulp-uglify');  // optional, only if you like to minify your code 
 var pump = require('pump');           // optional, only if you use 'gulp-uglify'
  
 gulp.src(["./any/SourceFolder/foo.js"])
  .pipe(angularEmbed())
  .pipe(uglify())                    // optional, for example: embaded and minifyed html and css
  .pipe(gulp.dest("./any/DestinationFolder/"));
   

Before


Maybe you have a Angularjs component like this. Than gulp-angular4-embedfromurl will embed the templateurl and styleUrls als inline. Bothe "myComponent.styleA.css" and "myComponent.styleB.css" will be enbed.

  // An angular typescript component
  import { Component } from '@angular/core';

  @Component({
	selector: 'myComponent',
	templateUrl: './myComponent.template.html'
	styleUrls:  ['./myComponent.styleA.css','./myComponent.styleB.css'] 
  })
  export class myComponent {
}

After


gulp-angular4-embedfromurl embeded the content and now the component looks like this. It also removed any linebreaks and duble whitespaces. Its not allowed to use singel quotation marks inside the html-template or stylesheet files!

 // An compiled angular typescript component
 
 // Normaly some lines of code, but for this example removed

var core_1 = require("@angular/core");
var myComponent = (function () {
   function myComponent() {
   }
   return myComponent;
}());
myComponent = __decorate([
   core_1.Component({
       selector: 'header',
       template:'<div class="col col-md-auto"><div class="input-group"><input type="text" class="form-control" placeholder="Search for..."><span class="input-group-btn"><button class="btn btn-secondary" type="button">Search</button></span></div></div><div class="col"></div><div class="col col-md-auto"><!-- Secondary, outline button --><button type="button" class="btn btn-secondary"><i class="fa fa-comments"aria-hidden="true"></i></button><!-- Secondary, outline button --><button type="button" class="btn btn-secondary"><i class="fa fa-bell-o" aria-hidden="true"></i></button><!-- Secondary, outline button --><button type="button" class="btn btn-secondary"><i class="fa fa-language" aria-hidden="true"></i></button><span>Matthias Just</span><i class="fa fa-sort-desc" aria-hidden="true"></i></div>',
       styles:['.gc-header span{font-weight:700;color:#808080}#body{bla:22}']
    })
 ], myComponent);
 exports.myComponent = myComponent;
Thanks and have fun with this plugin! Cosmin, France