capture method missing in node.js
npm i methodmissing
mm = require('methodmissing');
fs = require('fs');
mmfs = mm(fs);
mmfs.existsSync('.'); // true
mmfs.existSync('.'); // missing
mm = require('methodmissing');
fs = mm('fs');
fs.existsSync('.'); // true
fs.existSync('.'); // missing
string
: returns required object inherited method missingobject
: returns object inherited method missing
- called on missing method called
var mm = require('methodmissing');
var fs = mm('fs', function (key, arg) {
console.log(key + " missing");
});
fs.existsSync('.'); // true, callback not called
fs.existSync('.'); // undefined, callback called [1]
// key: 'existSync'
// arg: { '0': '.' }