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

browserify-ng-html2js

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-ng-html2js - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

17

lib/index.js
var fs = require('fs'),
through = require('through'),
ngHtml2Js = require('ng-html2js'),
burrito = require('burrito');
ngHtml2Js = require('ng-html2js');

@@ -32,17 +31,7 @@ function isExtension (file, extension) {

function end () {
var content, src, fileName, exportCall;
var content, src, fileName;
try {
fileName = file.match(/^.*\/(.*)$/)[1];
content = fs.readFileSync(file, 'utf-8');
// Function that will be prepended in order to export angular module in a wrapped function
exportCall = 'function exportNgModule(ngModule){ module.exports = ngModule }\n\n';
// Burrito will wrap the module.run call around a call of the above function in order to export the module
src = exportCall + burrito(ngHtml2Js(fileName, content, opts.module), function (node) {
if(node.name === 'call' && node.label() === 'run') {
node.wrap('exportNgModule(%s)');
}
});
src = ngHtml2Js(fileName, content, opts.module, 'ngModule') + '\nmodule.exports = ngModule;';
} catch (error) {

@@ -49,0 +38,0 @@ this.emit('error', error);

5

package.json
{
"name": "browserify-ng-html2js",
"version": "0.3.0",
"version": "0.3.1",
"description": "Browserify transform to compile angular templates into angular modules",

@@ -17,4 +17,3 @@ "main": "lib/index.js",

"dependencies": {
"burrito": "^0.2.12",
"ng-html2js": "^1.2.0",
"ng-html2js": "^2.0.0",
"through": "^2.3.6"

@@ -21,0 +20,0 @@ },

@@ -5,7 +5,11 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

},{"./template.html":2}],2:[function(require,module,exports){
function exportNgModule(ngModule){ module.exports = ngModule }
var ngModule = angular.module('template.html', []);
ngModule.run(['$templateCache', function($templateCache) {
$templateCache.put('template.html',
'<h2>This is an html template</h2>\n' +
'<p>and it should be transformed into a browserify wrapped angular template module</p>\n' +
'');
}]);
exportNgModule(angular.module("template.html", []).run([ "$templateCache", function($templateCache) {
$templateCache.put("template.html", "<h2>This is an html template</h2>\n" + "<p>and it should be transformed into a browserify wrapped angular template module</p>\n" + "");
} ]));
module.exports = ngModule;
},{}]},{},[1]);

@@ -5,14 +5,17 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

},{"./template.html":2}],2:[function(require,module,exports){
function exportNgModule(ngModule){ module.exports = ngModule }
var ngModule;
try {
ngModule = angular.module('templates');
} catch (e) {
ngModule = angular.module('templates', []);
}
(function(module) {
try {
module = angular.module("templates");
} catch (e) {
module = angular.module("templates", []);
}
exportNgModule(module.run([ "$templateCache", function($templateCache) {
$templateCache.put("template.html", "<h2>This is an html template</h2>\n" + "<p>and it should be transformed into a browserify wrapped angular template module</p>\n" + "");
} ]));
})(module);
ngModule.run(['$templateCache', function ($templateCache) {
$templateCache.put('template.html',
'<h2>This is an html template</h2>\n' +
'<p>and it should be transformed into a browserify wrapped angular template module</p>\n' +
'');
}]);
module.exports = ngModule;
},{}]},{},[1]);
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