Gathering detailed insights and metrics for mmmagic
Gathering detailed insights and metrics for mmmagic
Gathering detailed insights and metrics for mmmagic
Gathering detailed insights and metrics for mmmagic
@types/mmmagic
TypeScript definitions for mmmagic
stream-mmmagic
sniff the start of a stream (non-destructively) to detect the file type and encoding
@picturae/mmmagic
An async libmagic binding for node.js for detecting content types by data inspection
mmmagic-type
Detect file type with [mmmagic](https://github.com/mscdex/mmmagic) and [mime](https://github.com/broofa/node-mime).
An async libmagic binding for node.js for detecting content types by data inspection
npm install mmmagic
Typescript
Module System
Min. Node Version
Node Version
NPM Version
C++ (67.93%)
JavaScript (27.99%)
Python (4.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
625 Stars
182 Commits
53 Forks
8 Watchers
1 Branches
5 Contributors
Updated on Jun 18, 2025
Latest Version
0.5.3
Package Id
mmmagic@0.5.3
Size
512.52 kB
NPM Version
6.4.1
Node Version
10.15.0
Published on
Apr 30, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
An async libmagic binding for node.js for detecting content types by data inspection.
npm install mmmagic
1 var Magic = require('mmmagic').Magic; 2 3 var magic = new Magic(); 4 magic.detectFile('node_modules/mmmagic/build/Release/magic.node', function(err, result) { 5 if (err) throw err; 6 console.log(result); 7 // output on Windows with 32-bit node: 8 // PE32 executable (DLL) (GUI) Intel 80386, for MS Windows 9 });
1 var mmm = require('mmmagic'), 2 Magic = mmm.Magic; 3 4 var magic = new Magic(mmm.MAGIC_MIME_TYPE); 5 magic.detectFile('node_modules/mmmagic/build/Release/magic.node', function(err, result) { 6 if (err) throw err; 7 console.log(result); 8 // output on Windows with 32-bit node: 9 // application/x-dosexec 10 });
1 var mmm = require('mmmagic'), 2 Magic = mmm.Magic; 3 4 var magic = new Magic(mmm.MAGIC_MIME_TYPE | mmm.MAGIC_MIME_ENCODING); 5 // the above flags can also be shortened down to just: mmm.MAGIC_MIME 6 magic.detectFile('node_modules/mmmagic/build/Release/magic.node', function(err, result) { 7 if (err) throw err; 8 console.log(result); 9 // output on Windows with 32-bit node: 10 // application/x-dosexec; charset=binary 11 });
1 var Magic = require('mmmagic').Magic; 2 3 var magic = new Magic(), 4 buf = new Buffer('import Options\nfrom os import unlink, symlink'); 5 6 magic.detect(buf, function(err, result) { 7 if (err) throw err; 8 console.log(result); 9 // output: Python script, ASCII text executable 10 });
(constructor)([< mixed >magicSource][, < Integer >flags]) - Creates and returns a new Magic instance. magicSource
(if specified) can either be a path string that points to a (compatible) magic file to use or it can be a Buffer containing the contents of a (compatible) magic file. If magicSource
is not a string and not false
, the bundled magic file will be used. If magicSource
is false
, mmmagic will default to searching for a magic file to use (order of magic file searching: MAGIC
env var -> various file system paths (see man file
)). flags is a bitmask with the following valid values (available as constants on require('mmmagic')
):
detectFile(< String >path, < Function >callback) - (void) - Inspects the file pointed at by path. The callback receives two arguments: an < Error > object in case of error (null otherwise), and a < String > containing the result of the inspection.
detect(< Buffer >data, < Function >callback) - (void) - Inspects the contents of data. The callback receives two arguments: an < Error > object in case of error (null otherwise), and a < String > containing the result of the inspection.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More