This repository has been archived by the owner. It is now read-only.
UNMAINTAINED. Returns its input.
Makefile JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
spec
src
.gitignore
.jshintrc
.travis.yml
Makefile
README.md
UNLICENSE
component.json
package.json

README.md

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.

Synopsis

rtrn is a JavaScript function that returns its input (equivalent to the I combinator).

stability 5 - locked license - Unlicense Flattr this

browser support

Build Status Coverage Status Dependencies

Why?

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.

Install

Node.js

With NPM

npm install rtrn

From source

git clone https://github.com/pluma/rtrn.git
cd rtrn
npm install
make

Browser

With component

component install pluma/rtrn

Learn more about component.

With bower

bower install rtrn

Learn more about bower.

With a CommonJS module loader

Download the latest minified CommonJS release and add it to your project.

Learn more about CommonJS modules.

With an AMD module loader

Download the latest minified AMD release and add it to your project.

Learn more about AMD modules.

As a standalone library

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.

Basic usage example

var rtrn = require('rtrn');

var hello = rtrn('hello');

console.log(hello); // 'hello'

API

rtrn(value):Function

Wraps the given value in a function.

Unlicense

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.