{"_id":"mime-magic","_rev":"58-790e80f9b583cd4630f32f74ae502b1a","name":"mime-magic","description":"Proper MIME type detection library that wraps the libmagic functionality","dist-tags":{"latest":"5.14.0"},"versions":{"0.1.0":{"name":"mime-magic","version":"0.1.0","main":"./lib/mime-magic.js","description":"libmagic bindings for node.js. Includes a file(1) wrapper as alternative.","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"_npmJsonOpts":{"file":"/home/saltwater/.npm/mime-magic/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mime-magic@0.1.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.17","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"a5cc7aae15ce866a7c48e661ebcf2d55aa72ea48","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.1.0.tgz","integrity":"sha512-7fS+1SVn/OlRWzqXL66GO/nj+pwg8xR0TNpBC+mQfsXGj4B5cT0nJn3VYI9jprJdwsNCCpvrojH23D2DaJAKZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2bER65JR1vbgY2CNcX/Yh2eSAiDWq1Lllfl7ozj8PaAiB3BGu1L9ZjnEqKD0sAzdg3mIqczrkFi4SJg7FsXcvEWQ=="}]},"scripts":{},"directories":{}},"0.1.1":{"name":"mime-magic","version":"0.1.1","main":"./lib/mime-magic.js","description":"libmagic bindings for node.js. Includes a file(1) wrapper as alternative.","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"_npmJsonOpts":{"file":"/home/saltwater/.npm/mime-magic/0.1.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mime-magic@0.1.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.17","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"9c9e69df6426f4d6d097583e2ee3e05bc2c5cbae","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.1.1.tgz","integrity":"sha512-UeHXqR25lyAMYPc4WnNhUECSk85lrayCte4ssc8MY5Z5rs0Py2kYqYawchaQNkoTcgYcVG2thTeq1dbBmTPHwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPWO8Qcxv7PtOmdyVnOR9HvZyAe0wdQA+0lq9f6dpPagIhAPPCJ2xvhso3HEWWT82qGOj5oYMQV6/DMrIggH0zAL7w"}]},"scripts":{},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.0":{"name":"mime-magic","version":"0.2.0","main":"./lib/mime-magic.js","description":"libmagic bindings for node.js. Includes a file(1) wrapper as alternative.","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"scripts":{"preinstall":"make build","preuninstall":"make purge"},"_npmJsonOpts":{"file":"/home/saltwater/.npm/mime-magic/0.2.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mime-magic@0.2.0","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.17","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"0a1fefa4f9af9b5fe645ded59ee82acddfaead71","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.0.tgz","integrity":"sha512-XAw7C6eK3K9WmdQqwvnr2g/VI/bSohDHejnDL55uQ3KXXommM122XOw98iosmG6bCIbLVihY9QOOqhqj5a+xOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQvUs/IxplWepY42M5vOPJiE+oAtTtfMK1c2HRSbrEPQIhAKRBOJKU6MSsmjqNRcgJ3qK9nGXENr//PTKwzTB71W2b"}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.1":{"name":"mime-magic","version":"0.2.1","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"scripts":{"preinstall":"make build","preuninstall":"make purge"},"_npmJsonOpts":{"file":"/home/saltwater/.npm/mime-magic/0.2.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"mime-magic@0.2.1","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.26","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"86f7bb600c6c13982c8be59b4b4b10fd280314c0","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.1.tgz","integrity":"sha512-s9zx2LYIBwNHyNzFSwt6mDK9yVCNA1FZJlWzZtSEpFkCbW7UTziaZw4b1OzR5yTN1iib8gBesSF6YGGdmZed0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjkthnEFov4IOdi4aWQ76k5LZkox99h7ss0q+2/+GURAIhANTtI1NJG79M1qt+uK4dr3uxLwOSiyaRwRZni7f5Ll2o"}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.2":{"name":"mime-magic","version":"0.2.2","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"scripts":{"preinstall":"make build","preuninstall":"make purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.2.2","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.103","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"4c87a1100a31ff8448362af3c039b151ed036980","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.2.tgz","integrity":"sha512-STZsrSxyO62pxa9FgrPtrWtqPP+27n8xazY8c8rmJKG1qGvnN4nUHymdNwcVGjBDJFp3cA5uKqw69uV+Z7SJxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCos+zaEqLHWsWx6jWXSbHo4xKocGJntVpVQemOz/OYoAIhAPZnaKs4iO3jkDCa4NtXvNY3Z4zV89SO7GpV7yvlZ3nH"}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.3":{"name":"mime-magic","version":"0.2.3","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper"],"scripts":{"preinstall":"make build","preuninstall":"make purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.2.3","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"6ad47ed49531a5fd18d72c2d1f0f1c72e5aa8cf2","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.3.tgz","integrity":"sha512-zumacfV5AY3SDXlb+bHkDjoe7TMRol6dJkbpjVQaScSF9xVTqB/WDQZkm+LFZ67qnDQfM7vjp8CYiOF0LKTfQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMXr3cdbcrmN4Euphb7FyNc8la1WMirWk75RLYJBtvZwIgPOPUUwmYBzKU5ahgL+YGLdxz/pNaoM/BuRbPrNOFtQ4="}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.4":{"name":"mime-magic","version":"0.2.4","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.2.4","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"c2445e69624eba3c66c32ece0a5c6cca043d16de","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.4.tgz","integrity":"sha512-NzfgbRx+S3sINuwH1fWtVGIG/3WJZqydowtTlSaBzUUlfQWr4DiZK8mY1qO1Og+bVW5BvMwtcMjhuhqwA9NLag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2V7ioCEdZFU+5VBdaxB14yYG3G1uB9zkG0KOv3lwGlAiEAiRG4ozK+R9VuZ5Q+dXmG5jYMoJ2XlrLXKz5QjCHjTSY="}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.5":{"name":"mime-magic","version":"0.2.5","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.2.5","dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"04f15aec9468810fc6748fe5ed26c8df0dca2e52","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.5.tgz","integrity":"sha512-pkB78kX3HHfRY8h4ysccXMem/5j0g207bxf2rTN1APiXqohemHSDtRuYZX/RA+PjxOHZ6F/R0E0XWojKFbu85Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcOfJXhnCwwxjUMa2SLwXmkl4rjg/thSzA9qGOqfikmwIgQ217WCBYOkBp1R86JebMSEJKBlWGRv30m+lfYQqYXpc="}]},"readme":"## About ![still maintained](http://stillmaintained.com/SaltwaterC/mime-magic.png)\n\nMIME type detection library for node.js. Unlike the existing [mime](https://github.com/bentomas/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which does it properly.\n\nCurrently it provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper to get the things moving, but in the long run, the purpose of this module is to provide proper node.js libmagic bindings. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary build with MinGW and compressed with UPX.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime.fileWrapper('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message); // ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type); // application/pdf\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime.fileWrapper('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime.fileWrapper('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The fileWrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notice\n\nThe module was developed under Ubuntu 10.04 and Windows 7. It was tested under OS X Snow Leopard and FreeBSD 8.2. Other platforms may be supported, but the behavior is untested.\n\n## Contributor\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server\n","maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.2.6":{"name":"mime-magic","version":"0.2.6","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.2.6","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"0a45ba3b2e795a1c1683771391240b1355e66ffc","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.2.6.tgz","integrity":"sha512-BS9j1OdL3mw6OVwPVqZRCJO41Rrhija+kiz/WiCvC7iiZKO6PpsSi+nXiwp0ue4rASouEnFmUWiPPPTQyBVxXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCq23UangFSJCyHaV6fJAqdHDu4WXc31aNrD2n8/IoNXQIhAOiZwHAGTzqVpUsKMaXz+8E3YHCDKVZdj1G4+XRJSPXP"}]},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.3.0":{"name":"mime-magic","version":"0.3.0","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge"},"_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"_id":"mime-magic@0.3.0","dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.25","_nodeVersion":"v0.8.0","_defaultsLoaded":true,"dist":{"shasum":"fab44499437e23687555278708d0f7fe090be4f5","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.3.0.tgz","integrity":"sha512-H7juFz/21Cc0BMSmCbBvyLJR9+LjdKaM21NoimRoU4Lt69dS0K9cYMGBVzpNPjB2uMDUj8lmqzRbOQMx822E9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzCr1hHi4yZslVO3TWY6RGNCG2oM6h/WRxJ7f5PYgyHAiAZs9a3XxCfsqUXDVVfdzxrEycWGYEHp9QX2o2sD4QgXg=="}]},"readme":"## About\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nCurrently it provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper to get the things moving, but in the long run, the purpose of this module is to provide proper node.js libmagic bindings. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary build with MinGW and compressed with UPX.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime.fileWrapper('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime.fileWrapper(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime.fileWrapper('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime.fileWrapper('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The fileWrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notices\n\nThe module is developed under Ubuntu 12.04, and Windows 7. It is tested under OS X Lion, and FreeBSD 9.0. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by myself under Windows 7 / MinGW + MSYS. The binaries are packed with the [UPX](http://upx.sourceforge.net/) tool in order to make them smaller.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/file/8e4b6b373538ff98be4df14af0f6ccbd6b1306febc0a37a2a5c7d26f6d8f30f6/analysis/1330428088/) (unpacked)\n * [file.exe](https://www.virustotal.com/file/bf1a01443588e75be0a0b674da0d0467e4203833c4de7a9a1507bffe46a57830/analysis/1330427980/) (packed)\n * [libmagic-1.dll](https://www.virustotal.com/file/0543b99145a57ab425fe48c7613ff85c32185554e6539df1df1ddaf8584755d8/analysis/1330428015/) (packed)\n * [libgnurx-0.dll](https://www.virustotal.com/file/fabb4a8ace8b841e418293fbd41fcb14dd851b1c1e33acd0414669a500cc9540/analysis/1330428002/) (packed)\n\nPlease notice that some antiviruses may throw false positives.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.4.0":{"name":"mime-magic","version":"0.4.0","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.x"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge"},"readme":"## About\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nCurrently it provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper to get the things moving, but in the long run, the purpose of this module is to provide proper node.js libmagic bindings. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary build with MinGW and compressed with UPX.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The file wrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notices\n\nThe mime.fileWrapper method is deprecated. The preferred method is to call the module directly.\n\nThe module is developed under Ubuntu 12.04, and Windows 7. It is tested under OS X Lion, and FreeBSD 9.0. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by myself under Windows 7 / MinGW + MSYS. The binaries are packed with the [UPX](http://upx.sourceforge.net/) tool in order to make them smaller.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/file/8e4b6b373538ff98be4df14af0f6ccbd6b1306febc0a37a2a5c7d26f6d8f30f6/analysis/1330428088/) (unpacked)\n * [file.exe](https://www.virustotal.com/file/bf1a01443588e75be0a0b674da0d0467e4203833c4de7a9a1507bffe46a57830/analysis/1330427980/) (packed)\n * [libmagic-1.dll](https://www.virustotal.com/file/0543b99145a57ab425fe48c7613ff85c32185554e6539df1df1ddaf8584755d8/analysis/1330428015/) (packed)\n * [libgnurx-0.dll](https://www.virustotal.com/file/fabb4a8ace8b841e418293fbd41fcb14dd851b1c1e33acd0414669a500cc9540/analysis/1330428002/) (packed)\n\nPlease notice that some antiviruses may throw false positives.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","_id":"mime-magic@0.4.0","dist":{"shasum":"ff696d1e6f688b837c2abf18878ecc206dd048c4","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.4.0.tgz","integrity":"sha512-XiwxU8ZKwFHy+caVkJKHET3I9Lv8W5wdLfrdslOWCTuB6EXOvYoMXbsBg8JZ/vJ/pWOoJnTQ9HgyYgTHhj4woQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjgWxxEQRjJT2gxJgKeqpF+7xVC+0i+jFrl2y0eCzQDwIgWU6L7/N0Ja7QGi+Wat/dAtjzQpf1pb5ERWfHJssRpto="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.4.1":{"name":"mime-magic","version":"0.4.1","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.9"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge","test":"make test"},"readme":"## About [![build status](https://secure.travis-ci.org/SaltwaterC/mime-magic.png)](http://travis-ci.org/SaltwaterC/mime-magic) ![stillmaintained](http://stillmaintained.com/SaltwaterC/mime-magic.png)\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nIt provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary build with MinGW.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The file wrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notices\n\nThe mime.fileWrapper method is deprecated. The preferred method is to call the module directly.\n\nThe module is developed under Ubuntu 12.04, and Windows 7. It is tested under OS X Lion, and FreeBSD 9.0. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by myself under Windows 7 / MinGW + MSYS.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/file/7141c8c0f7a8dbc7c9f2108c72565ad69cf248b88a3d274a41e7242a8cf7b1d4/analysis/1352984623/)\n * [libgnurx-0.dll](https://www.virustotal.com/file/ff6104a6c02ccebde66fb988924412cbdf9fd8b5e5a1a0699833b3892048d688/analysis/1352984639/)\n\nPlease notice that some antiviruses may throw false positives.\n\nnode.js libmagic bindings were initially planned. The plans for adding them are suspended. The library gets the job done. If you feel like contributing such support, pull requests are welcome. Beware: since v0.4.1 libmagic(3) is statically linked into file(1). You need to revert to building the libmagic part as dynamic library in order to implement the node.js bindings.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","readmeFilename":"README.md","_id":"mime-magic@0.4.1","dist":{"shasum":"15e2d896e567d07cc4d5257b5a5e374fe9d2082d","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.4.1.tgz","integrity":"sha512-Q2AX1KcyZM+Vh52s9A4dCP1+gHMkn1pB4yZgG1FY6UOYq72lw0F3a19DRUj9kGwopBepCtoKFPvXPhNA08PBSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ6Kmp+FbzJ9z3aFATJa37z7Dm+KnhHdoE0XWFbCAB4wIhAOUcP45gvjiIk4p7J62iv9J/l0NTS09kdw11vKXFj/Nv"}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.4.2":{"name":"mime-magic","version":"0.4.2","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.9"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge","test":"make test"},"readme":"## About [![build status](https://secure.travis-ci.org/SaltwaterC/mime-magic.png?branch=master)](http://travis-ci.org/SaltwaterC/mime-magic) ![stillmaintained](http://stillmaintained.com/SaltwaterC/mime-magic.png)\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nIt provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary built under cygwin 1.7.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The file wrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notices\n\nThe mime.fileWrapper method is deprecated. The preferred method is to call the module directly as function.\n\nThe module is developed under Ubuntu 12.04, Windows 7, and Mac OS X 10.8. It is tested FreeBSD 9.1. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by me under Windows 7 / cygwin 1.7.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/file/141152a364fe3fdb981f42b959b8bb306af21e8532d3931c76f2b9b4601c2254/analysis/1359210729/)\n * [cygwin1.dll](https://www.virustotal.com/file/df4e2115c80d07ca4345ba92053dcc38c4002554677a04509d02669a50ab86bf/analysis/1359210741/)\n\nPlease notice that some antiviruses may throw false positives.\n\nnode.js libmagic bindings were initially planned. The plans for adding them are suspended. The library gets the job done. If you feel like contributing such support, pull requests are welcome. Beware: since v0.4.1 libmagic(3) is statically linked into file(1). You need to revert to building the libmagic part as dynamic library in order to implement the node.js bindings.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","readmeFilename":"README.md","_id":"mime-magic@0.4.2","dist":{"shasum":"55f5867a250fb4097ef6f81a2e1886387e3650ca","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.4.2.tgz","integrity":"sha512-0evkA1IYjtkOscAPYPidmeTd3IAdfm0H8AI3SZHqW0Cb7TMOBNuTrq/1g0JcWWAuSlfZcQzH/haf5cPAScSI8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH1LTZAR4kzZYpZixfX1QEI5Pv30NJqNHBLli5zjI6LECIQDrcZEX2/3VkOuzucCQ8WckYEam+ynsS5KMYupopqpvxA=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"directories":{}},"0.4.3":{"name":"mime-magic","version":"0.4.3","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.9"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge","test":"make test"},"readme":"## About [![build status](https://secure.travis-ci.org/SaltwaterC/mime-magic.png?branch=master)](http://travis-ci.org/SaltwaterC/mime-magic) ![stillmaintained](http://stillmaintained.com/SaltwaterC/mime-magic.png)\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nIt provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary built under cygwin 1.7.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The file wrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\n## Notices\n\nThe mime.fileWrapper method is deprecated. The preferred method is to call the module directly as function.\n\nThe module is developed under Ubuntu 12.04, Windows 7, and Mac OS X 10.8. It is tested FreeBSD 9.1. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by me under Windows 7 / cygwin 1.7.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/en/file/2a44dadb748a93ac87ad10f643426192d7beb993c4046fe546b1fb11981e7f0b/analysis/1363079646/)\n * [cygwin1.dll](https://www.virustotal.com/file/df4e2115c80d07ca4345ba92053dcc38c4002554677a04509d02669a50ab86bf/analysis/1359210741/)\n\nPlease notice that some antiviruses may throw false positives.\n\nnode.js libmagic bindings were initially planned. The plans for adding them are suspended. The library gets the job done. If you feel like contributing such support, pull requests are welcome. Beware: since v0.4.1 libmagic(3) is statically linked into file(1). You need to revert to building the libmagic part as dynamic library in order to implement the node.js bindings.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","readmeFilename":"README.md","_id":"mime-magic@0.4.3","dist":{"shasum":"dc00fe48462c63485c4eb094638e94c748486155","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-0.4.3.tgz","integrity":"sha512-3kfaJEuF6iM+qmnJFYr5rALHzEOA+IgQmyb0WVPgn2Msvinv6gMSjLP0ucP/gFcrAoYIueuYqQeYcE/QGV1R6g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGOLeb2MJzbM/8mkDtq+QYKofoTpiDHfXdnDJQqZLslaAiEAlPP8/wY6JMnkbyVSaETqYmQHhPC0Dylh2VJIN64zCqA="}]},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}]},"5.14.0":{"name":"mime-magic","version":"5.14.0","main":"./lib/mime-magic.js","description":"Proper MIME type detection library that wraps the libmagic functionality","engines":{"node":">=0.4.9"},"dependencies":{"config":">= 0.4.21"},"devDependencies":{"js-beautify":">= 0.4.2","jslint":">= 0.1.9"},"homepage":"https://github.com/SaltwaterC/mime-magic","author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"contributors":[{"name":"Felix Chan","url":"https://github.com/felixchan"},{"name":"eddyb","url":"https://github.com/eddyb"}],"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"keywords":["mime","magic","libmagic","file","wrapper","windows","win32"],"scripts":{"preinstall":"node make.js build","preuninstall":"node make.js purge","test":"make test"},"readme":"## About [![build status](https://secure.travis-ci.org/SaltwaterC/mime-magic.png?branch=master)](http://travis-ci.org/SaltwaterC/mime-magic)\n\nMIME type detection library for node.js. Unlike the [mime](https://github.com/broofa/node-mime) module, mime-magic does not return the type by interpreting the file extension. Instead it uses the [libmagic(3)](http://linux.die.net/man/3/libmagic) library which provides the result by reading the \"magic number\" of the file itself.\n\nIt provides just a simple [file(1)](http://linux.die.net/man/1/file) wrapper. The file(1) source tree is provided along with this package. It is built during the installation process. The module aims to use the latest available file version along with the up-to-date magic database.\n\nThe Windows version of file(1) is bundled with the package. It is a native binary built under cygwin 1.7. The new versioning scheme of mime-magic follows the version number of the upstream file(1) development. mime-magic x.y.z means bundled with file(1) version x.y, patch level z.\n\n## Installation\n\nEither manually clone this repository into your node_modules directory, run `make build` (under unices), or the recommended method:\n\n> npm install mime-magic\n\nYou need a working gcc toolchain and GNU or BSD make in order to use the bundled file(1) version.\n\nIf the installation of the bundled file(1) fails and you do not wish to install the gcc toolchain and a make utility, mime-magic provides [config](https://github.com/lorenwest/node-config) support, but this is *unsupported* functionality aka if things break, you're on your own. For more details, refer to the [config online documentation](http://lorenwest.github.com/node-config/latest/).\n\nThe configuration file contents:\n\n```javascript\n/* default.json */\n\n{\n\t\"mime-magic\": {\n\t\t\"file\": \"path/to/file\", // the path to file(1)\n\t\t\"magic\": \"path/to/magic.mgc\" // the path to the coresponding magic.mgc\n\t\t\"absolute\": true // absolute paths, otherwise they are handled as relative to __dirname of mime-magic.js (mime-magic/lib)\n\t}\n}\n```\n\nExample for an OS X 10.8 file 5.13 installed with [Homebrew](http://mxcl.github.com/homebrew/):\n\n```javascript\n{\n\t\"mime-magic\": {\n\t\t\"file\": \"/usr/local/Cellar/file-formula/5.13/bin/file\",\n\t\t\"magic\": \"/usr/local/Cellar/file-formula/5.13/share/misc/magic.mgc\",\n\t\t\"absolute\": true\n\t}\n}\n```\n\nPlease *do not open issues* if you use the config support instead of the bundled file(1), unless there's a provable issue with the config implementation itself. There are strong reasons behind the decision for providing the bundle: consistency and reliability. As example, file 5.04 which ships with OS X 10.8, is utterly broken:\n\n```bash\nfile foo\nfoo: cannot open `foo' (No such file or directory)\necho $?\n0\nfile foo 2>/dev/null\nfoo: cannot open `foo' (No such file or directory)\necho $?\n0\n```\n\nIn plain English: the command exists with succes and it sends its output to STDOUT instead of STDERR even though it fails to read a proper MIME type as the file does not exist. Detecting a failure is impossible without braindead measures.\n\n## Usage mode\n\n```javascript\nvar mime = require('mime-magic');\n\nmime('/path/to/foo.pdf', function (err, type) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t} else {\n\t\tconsole.log('Detected mime type: %s', type);\n\t\t// application/pdf\n\t}\n});\n```\n\nYou may use an array of paths. The callback gets an array of mimes:\n\n```javascript\nvar files = [\n\t'/path/to/foo.pdf',\n\t'/path/to/foo.txt'\n];\n\nmime(files, function (err, types) {\n\tif (err) {\n\t\tconsole.error(err.message);\n\t\t// ERROR: cannot open `/path/to/foo.pdf' (No such file or directory)\n\t\t// ERROR: cannot open `/path/to/foo.txt' (No such file or directory)\n\t} else {\n\t\tconsole.log(types);\n\t\t// ['application/pdf', 'text/plain']\n\t}\n});\n```\n\nUnder Windows, you must escape the backslash separators of the path argument:\n\n```javascript\nmime('C:\\\\path\\\\to\\\\foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nYou may also pass a path that uses forward slashes as separators:\n\n```javascript\nmime('C:/path/to/foo.pdf', function (err, type) {\n\t// do something\n});\n```\n\nPassing relative paths is supported. The file wrapper uses child_process.execFile() behind the scenes, therefore the err argument contains the information returned by the execFile() method itself plus the error message returned by file(1).\n\nYou can take a peek at the paths resolved internally by the library.\n\nmime.fileExec  => the absolute path to the file(1) binary\nmime.magicFile => the absolute path to the magic.mgc database\n\n## Notices\n\nThe mime.fileWrapper method is deprecated. The preferred method is to call the module directly as function.\n\nThe module is developed under Ubuntu 12.04, Windows 7, and Mac OS X 10.8. It is tested FreeBSD 9.1. Other platforms may be supported, but the behavior is untested.\n\nThe Windows binaries are built by me under Windows 7 / cygwin 1.7.\n\nHere's the virustotal.com analysis:\n\n * [file.exe](https://www.virustotal.com/en/file/ed1afbc74c59f1a2087c4cf1889b72793470d129f9d16c5357235ec891cabcac/analysis/1364565832/)\n * [cygwin1.dll](https://www.virustotal.com/file/df4e2115c80d07ca4345ba92053dcc38c4002554677a04509d02669a50ab86bf/analysis/1359210741/)\n\nPlease notice that some antiviruses may throw false positives.\n\nnode.js libmagic bindings were initially planned. The plans for adding them are suspended. The library gets the job done. If you feel like contributing such support, pull requests are welcome. Beware: since v0.4.1 libmagic(3) is statically linked into file(1). You need to revert to building the libmagic part as dynamic library in order to implement the node.js bindings.\n\n## Contributors\n\n * [Felix Chan](https://github.com/felixchan) - [#1](https://github.com/SaltwaterC/mime-magic/pull/1): couldn't use fileWrapper more than once unless restarted server.\n * [eddyb](https://github.com/eddyb) - [#3](https://github.com/SaltwaterC/mime-magic/pull/3): support for arrays of paths, with the callback getting an array of mime-types.\n","readmeFilename":"README.md","_id":"mime-magic@5.14.0","dist":{"shasum":"3623970bcfa770c1baeaec6623f0c94d285f4241","tarball":"https://registry.npmjs.org/mime-magic/-/mime-magic-5.14.0.tgz","integrity":"sha512-AdGnSAYst5velQ8zua6IRolEPQgtfs7f6Wy4V4PSeWh1IXve4xoaISMU//sQDXIiFFB4OPt8KofmUuKSFtK9Vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxb43Z4BpqAU/PJNHgAMdIZqyHSvhErUe9Muz72hV4NQIgPscjDkJW6KcU1OYOuDcZOd4c/iN0v5IC2BMfFEvmSQE="}]},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"saltwaterc","email":"saltwaterc@gmail.com"},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}]}},"maintainers":[{"name":"saltwaterc","email":"saltwaterc@gmail.com"}],"time":{"modified":"2022-06-19T19:54:46.327Z","created":"2011-07-28T14:29:04.530Z","0.1.0":"2011-07-28T14:29:05.257Z","0.1.1":"2011-08-01T15:07:14.852Z","0.2.0":"2011-08-11T12:37:55.512Z","0.2.1":"2011-09-01T10:16:03.683Z","0.2.2":"2011-11-04T12:18:13.380Z","0.2.3":"2011-12-13T10:20:55.471Z","0.2.4":"2012-01-31T09:26:03.956Z","0.2.5":"2012-02-14T22:33:52.460Z","0.2.6":"2012-02-28T14:56:02.024Z","0.3.0":"2012-08-09T12:29:34.225Z","0.4.0":"2012-10-04T09:55:30.366Z","0.4.1":"2013-01-19T13:53:32.307Z","0.4.2":"2013-01-27T16:08:32.154Z","0.4.3":"2013-03-12T09:19:37.606Z","5.14.0":"2013-03-29T14:56:40.288Z"},"author":{"name":"Stefan Rusu","url":"http://www.saltwaterc.eu/"},"repository":{"type":"git","url":"git://github.com/SaltwaterC/mime-magic.git"},"users":{"dantman":true}}