nan-banana
v1.0.0
Published
Organic banana, locally sourced from NaN. Zero dependencies. Zero purpose.
Maintainers
Readme
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-bananaUsage
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.
