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 1.0.1 to 1.1.0

test/fixtures/output-prefix.js

6

CHANGELOG.md
# Changelog
# 1.0.1
## 1.1.0
* Support prefixes for template names
## 1.0.1
* Template path is printed correctly on windows when using baseDir option

@@ -6,0 +10,0 @@

@@ -24,2 +24,3 @@ var fs = require('fs'),

opts.baseDir = opts.baseDir || null;
opts.prefix = opts.prefix || '';

@@ -41,2 +42,3 @@ var fileMatching = new RegExp("^.*\\" + path.sep + "(.*)$");

fileName = opts.baseDir ? file.replace(path.join(appDir, opts.baseDir), '').replace(/\\/g, '/') : file.match(fileMatching)[1];
fileName = opts.prefix + fileName;
content = fs.readFileSync(file, 'utf-8');

@@ -43,0 +45,0 @@ src = ngHtml2Js(fileName, content, opts.module, 'ngModule') + '\nmodule.exports = ngModule;';

2

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

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -56,2 +56,3 @@ # browserify-ng-html2js

baseDir: "src/js" // optionally specify base directory for filename
prefix: '' // optionally specify a prefix to be added to the filename
}))

@@ -58,0 +59,0 @@ .bundle()

@@ -81,2 +81,18 @@ var browserify = require('browserify'),

});
it('should add prefix to filename if one is provided', function(done) {
var output = fs.readFileSync(__dirname + '/fixtures/output-prefix.js', 'utf-8');
browserify(__dirname + '/fixtures/app.js')
.transform(ngHtml2Js({
prefix: '/app.templates/'
}))
.bundle(function(err, bundle) {
if (err) {
done(err)
} else {
expect(output).to.equal(bundle.toString());
done();
};
});
});
})
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