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

browserify-versionify

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-versionify - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

21

index.js

@@ -5,6 +5,5 @@ var findRoot = require('find-root'),

function versionify(options) {
function versionify(file, options) {
options = options || {};
var filter = options.filter,

@@ -16,12 +15,16 @@ placeholder = options.placeholder || '__VERSION__',

return function(file, opts) {
if (filter && !filter.test(file)) return through2();
return through2({objectMode: true}, function(chunk, encoding, callback) {
return callback(null, chunk.toString().replace(re, version))
});
if (filter && !filter.test(file)) {
return through2();
}
return through2({objectMode: true}, function(chunk, encoding, callback) {
return callback(null, chunk.toString().replace(re, version));
});
}
exports = module.exports = versionify();
versionify.configure = function(options) {
return function(file) {
return versionify(file, options);
};
};
exports.configure = versionify;
module.exports = versionify;
{
"name": "browserify-versionify",
"version": "1.0.3",
"version": "1.0.4",
"description": "Browserify transform to replace placeholder with package version",

@@ -17,5 +17,5 @@ "keywords": [

"author": {
"name": "Lars Kappert",
"email": "lars@webpro.nl",
"url": "http://webpro.nl"
"name": "Lars Kappert",
"email": "lars@webpro.nl",
"url": "http://webpro.nl"
},

@@ -22,0 +22,0 @@ "license": "MIT",

@@ -11,14 +11,14 @@ # browserify-versionify

browserify -t versionify
browserify -t browserify-versionify
From Node.js:
browserify().transform(versionify);
browserify().transform('browserify-versionify');
// Configure (default values shown)
browserify().transform(versionify.configure({
browserify().transform('browserify-versionify', {
placeholder: '__VERSION__',
version: pkg.version
}));
});
You can also provide a `filter` property to whitelist files to apply the transform to (e.g. `filter: /\.js$/`).
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