Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CoffeeScript
Branch: master

0.0.3

latest commit 07340035ca
@geta6 authored
Failed to load latest commit information.
lib 0.0.3
src not pack return value if property exists #2
test first commit
.gitignore first commit
.npmignore readme
Cakefile first commit
README.md Update README.md
package.json 0.0.3

README.md

node-methodmissing

capture method missing in node.js

install

npm i methodmissing

usage

inherits method missing

mm = require('methodmissing');
fs = require('fs');
mmfs = mm(fs);

mmfs.existsSync('.');  // true
mmfs.existSync('.');   // missing

require with method missing

mm = require('methodmissing');
fs = mm('fs');

fs.existsSync('.');  // true
fs.existSync('.');   // missing

mm(object, callback)

object [ string | object ]

  • string: returns required object inherited method missing
  • object: returns object inherited method missing

callback [ function (key, arg) ]

  • 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': '.' }
Something went wrong with that request. Please try again.