https://github.com/sgtlambda/functionify
Wraps non-function values in a getter function
https://github.com/sgtlambda/functionify
Last synced: about 1 year ago
JSON representation
Wraps non-function values in a getter function
- Host: GitHub
- URL: https://github.com/sgtlambda/functionify
- Owner: sgtlambda
- License: mit
- Created: 2015-03-04T16:55:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-19T15:37:59.000Z (over 10 years ago)
- Last Synced: 2025-03-16T08:35:38.358Z (about 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# functionify
> Wraps non-function values in a getter function
[![Build Status][travis-image]][travis-url]
[![Code Coverage][coveralls-image]][coveralls-url]
[![NPM Version][npm-image]][npm-url]
## Install
```
$ npm install --save functionify
```
## Usage
```js
var functionify = require('functionify');
var getter;
getter = functionify('foo');
getter();
//=> 'foo'
getter = functionify(function(){
return 'bar';
});
getter();
//=> 'bar'
```
## License
MIT © JM Versteeg
[![devDependency Status][david-dev-image]][david-dev-url]
[travis-image]: https://img.shields.io/travis/jmversteeg/functionify.svg?style=flat-square
[travis-url]: https://travis-ci.org/jmversteeg/functionify
[david-dev-image]: https://img.shields.io/david/dev/jmversteeg/functionify.svg?style=flat-square
[david-dev-url]: https://david-dm.org/jmversteeg/functionify#info=devDependencies
[coveralls-image]: https://img.shields.io/coveralls/jmversteeg/functionify.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/jmversteeg/functionify
[npm-image]: https://img.shields.io/npm/v/functionify.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/functionify