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

fuse

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuse - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

test/result/depends/basic-depends-output.js

7

bin/fuse.js
#!/usr/bin/env node
var colors = require('colors');
var fs = require('fs');

@@ -17,3 +18,3 @@ var _ = require('underscore');

fuse.watchSrcFile(relativePath + path.path, argv.i, argv.o);
console.log('Watching ' + path.path + ' for changes.');
console.log('Watching ' + colors.cyan( path.path ) + ' for changes.');
});

@@ -23,3 +24,3 @@

fuse.watchFile(argv.i, argv.o);
console.log('Watching ' + argv.i + ' for changes.\nCTRL + C to stop.');
console.log('Watching ' + colors.cyan( argv.i ) + ' for changes.\nCTRL + C to stop.');

@@ -31,2 +32,2 @@ } else {

}
}

@@ -0,1 +1,2 @@

var colors = require('colors');
var fs = require('fs');

@@ -7,4 +8,18 @@ var _ = require('underscore');

// regular expression to find referenced files
var re = fuse.re = /\/\/ ?@depends (.+)\b/gi;
var re = fuse.re = /\/\/ ?@(?:depends|import) (.+)\b/gi;
fuse.formatTime = function () {
var d = new Date();
return [
d.getHours(),
':',
d.getSeconds(),
'.',
d.getSeconds()
].join('');
}
// core function for parsing and outputing a fused file

@@ -26,6 +41,6 @@ fuse.fuseFile = function (inputFile, outputFile, exit) {

var output = content;
// do we have anything to combine?
if (!matches) {
console.log('All done, there was nothing to combine.');
if (!matches.length) {
console.log('All done, there was nothing to combine (output file was not generated).'.blue);
if (exit) process.exit(0);

@@ -63,6 +78,6 @@ }

if (err) {
console.log('Failed to write to file.');
console.log('Failed to write to file.'.red);
process.exit(1);
} else {
console.log('Updated ' + outputFile + ', fusing ' + (matches.length+1) + ' files.\n');
console.log('Updated ' + colors.green(outputFile) + ', fusing ' + (matches.length+1) + ' files @ ' + colors.green(fuse.formatTime()) + '.\n');
if (exit) process.exit();

@@ -84,3 +99,3 @@ }

if (curr.mtime.getTime() !== prev.mtime.getTime()) {
console.log(inputFileName + ' changed.');
console.log(colors.blue(( inputFileName ) + ' changed.'));
fuse.fuseFile(inputFile, outputFile, false);

@@ -104,3 +119,3 @@ }

if (curr.mtime.getTime() !== prev.mtime.getTime()) {
console.log(srcFileName + ' changed.');
console.log(colors.blue(srcFileName + ' changed.'));
fuse.fuseFile(inputFile, outputFile, false);

@@ -120,3 +135,3 @@ }

} catch (e) {
console.log('Unable to read input file %s', inputFile);
console.log('Unable to read input file %s'.red, inputFile);
process.exit(1);

@@ -123,0 +138,0 @@ }

@@ -8,7 +8,7 @@ {

"repository" : {"type": "git", "url": "https://github.com/smebberson/fuse.git"},
"dependencies" : { "underscore": ">=1.2.0", "optimist": ">=0.2.8" },
"dependencies" : { "underscore": ">=1.2.0", "optimist": ">=0.2.8", "colors": ">=0.5.1" },
"bin" : { "fuse": "./bin/fuse.js" },
"directories" : { "bin": "./bin" },
"version" : "0.0.4",
"version" : "0.0.5",
"engines" : {"node": ">=0.4"}
}
}

Sorry, the diff of this file is not supported yet

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