Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nan-banana

Organic banana, locally sourced from NaN.

const banana = require("nan-banana");

banana();
// "banana"

Why

Because JavaScript can do this:

("b" + "a" + + "a" + "a").toLowerCase();
// "banana"

+"a" is NaN.

"ba" + NaN + "a" is "baNaNa".

.toLowerCase() completes the harvest.

The expression belongs to JavaScript folklore and was crystallized for many developers by Gary Bernhardt's WAT talk.

Install

npm install nan-banana

Usage

CommonJS:

const banana = require("nan-banana");

console.log(banana()); // "banana"

ES modules:

import banana from "nan-banana";

console.log(banana()); // "banana"

TypeScript:

import banana = require("nan-banana");

const fruit: "banana" = banana();

With esModuleInterop or allowSyntheticDefaultImports:

import banana from "nan-banana";

const fruit: "banana" = banana();

API

banana()

Returns the string literal "banana".

No options. No configuration. No ripeness control.

Properties

  • 100% organic JavaScript banana.
  • Locally sourced from NaN.
  • Zero dependencies.
  • Zero calories.
  • Zero purpose.
  • Contains potassium in spirit only.

Production

Not for production banana generation.

For production bananas, go to Woolworths.

License

MIT.

About

Organic banana, locally sourced from NaN.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages