NOTE: This package is no longer being maintained. If you are interested in taking over as maintainer or are interested in the npm package name, get in touch by creating an issue.
rtrn is a JavaScript function that returns its input (equivalent to the I
combinator).
It's trivial to implement, but in order to keep code DRY (and avoid silly mistakes) it makes sense to define this function only once per project. This library is the logical consequence of that.
npm install rtrn
git clone https://github.com/pluma/rtrn.git
cd rtrn
npm install
make
component install pluma/rtrn
bower install rtrn
Download the latest minified CommonJS release and add it to your project.
Learn more about CommonJS modules.
Download the latest minified AMD release and add it to your project.
Download the latest minified standalone release and add it to your project.
<script src="/your/js/path/rtrn.globals.min.js"></script>
This makes the rtrn
function available in the global namespace.
var rtrn = require('rtrn');
var hello = rtrn('hello');
console.log(hello); // 'hello'
Wraps the given value in a function.
This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.