libmagic bindings for node.js.
C++ JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.creole
TODO.creole
magic.cc
package.json
test.js
wscript

README.creole

Magic

This is a libmagic binding for node.js.

Usage

var Magic = require('magic'); //Load the library
var magic = Magic.create(Magic.MAGIC_MIME); //We want MIME output
magic.file("/path/to/image.png", function(err, type) {
	if (err)
		throw err;
	
	//Outputs "image/png"
	console.log(type);
});