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

fpcalc

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fpcalc - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

12

index.js

@@ -29,3 +29,8 @@ /* jshint node:true */

args.push(file);
if (file && typeof file.pipe === "function") {
args.push("-");
options.stdin = file;
} else {
args.push(file);
}

@@ -75,2 +80,7 @@ run(args, options)

// If passed stdin stream, pipe it to the child process
if (options.stdin) {
options.stdin.pipe(cp.stdin);
}
// Pass fpcalc stdout through the stream

@@ -77,0 +87,0 @@ cp.stdout.pipe(stream);

2

package.json
{
"name": "fpcalc",
"version": "1.2.1",
"version": "1.3.0",
"description": "Calculate AcoustID audio fingerprint",

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

@@ -43,4 +43,6 @@ # fpcalc

*File* must be the path to an audio file.
*File* must be the path to an audio file or a readable stream.
If using a stream, note that you will not get `duration` out due to an [fpcalc issue](https://github.com/acoustid/chromaprint/issues/53).
*Options* may be an object with any of the following keys:

@@ -47,0 +49,0 @@

@@ -5,2 +5,3 @@ /* jshint node:true */

var path = require("path"),
fs = require("fs"),
test = require("tape"),

@@ -56,1 +57,26 @@ fpcalc = require("../");

});
test("stream input", function(t) {
t.plan(5);
fpcalc(fs.createReadStream(TEST_FILE), {raw: true}, function(err, result) {
t.ok(result.fingerprint);
t.ok(Buffer.isBuffer(result.fingerprint));
});
fpcalc(fs.createReadStream(TEST_FILE), function(err, result) {
t.ok(result.fingerprint);
t.equal(typeof result.fingerprint, "string");
t.ok(/^[-_a-zA-Z0-9]+$/.test(result.fingerprint));
});
});
test("stream fignerprint is the same as file fingerprint", function(t) {
t.plan(1);
fpcalc(fs.createReadStream(TEST_FILE), function(err, streamResult) {
fpcalc(TEST_FILE, function(err, fileResult) {
t.equal(fileResult.fingerprint, streamResult.fingerprint);
});
});
});
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