-
-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (15 loc) · 596 Bytes
/
index.js
File metadata and controls
23 lines (15 loc) · 596 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';
var probeStream = require('./stream');
var probeHttp = require('./http');
/* eslint-disable consistent-return */
module.exports = function get_image_size(src, options) {
if (typeof src.on === 'function' && typeof src.emit === 'function') {
// looks like an EventEmitter, treating it as a stream
return probeStream(src, options);
}
// HTTP (not stream)
return probeHttp(src, options || {});
};
module.exports.parsers = require('./lib/parsers_stream');
module.exports.sync = require('./sync');
module.exports.Error = require('./lib/common').ProbeError;