diff --git a/README.md b/README.md index e9a9416..8727f55 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ npm install stream-mmmagic ## Use ``` var magic = require('stream-mmmagic'); -// optional: provide custom magic-file -magic.config.magicFile = 'path/to/custom/magic/file'; var input = fs.createReadStream('somefile.csv'); @@ -35,6 +33,16 @@ magic(input, function (err, mime, output) { //- ``` +### Custom Magic File +A magic file is bundled with the mmmagic npm module but if you want to use your own then set +`magic.config.magicFile` before calling `magic`. + +``` +magic.config.magicFile = '/path/to/custom/magic/file'; + +magic(input, callback); // uses above magic file +``` + ## NOTICE This uses [buffer-peek-stream](https://github.com/seangarner/node-buffer-peek-stream) under the covers which is, at the moment, best described as experimental. diff --git a/package.json b/package.json index 449cd50..50e42e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stream-mmmagic", - "version": "0.2.0", + "version": "0.3.0", "description": "Node module to sniff the start of a stream (non-destructively) to detect the file type and encoding", "main": "lib/stream-mmmagic.js", "scripts": {