npm

Need private packages and team management tools?Check out npm Orgs. »

mk-fn

1.0.1 • Public • Published

mk-fn build

This module allows you to create a function with a given length property. This is used for certain functional programming facilities, and is used in pogostic to be able to create remote functions which have the same length property on the server as the client.

Here are some reasons why you would use this instead of other libraries.

  • Performance.
  • Security: The alternative workaround is to use eval, which depending on what your security policy is, might not be acceptable.
  • Flexibility: This module supports up to 27 arguments, more than you'll ever need.
var mkFn = require('mk-fn');
var fun = function() {};
console.log(fun.length); // -> 0
var fn4 = mkFn(fun, 4);
console.log(fn4.length); // -> 4

install

npm i mk-fn

Downloadsweekly downloads

4

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability