npm.io
1.0.0 • Published 7 years ago

meaningless

Licence
GPL-3.0
Version
1.0.0
Deps
0
Size
1 kB
Vulns
0
Weekly
0
Stars
1

Meaningless

Write meaningful JavaScript by using real life words like yes/no, on/off instead of booleans.

Install:

npm install meaningless

Include:

require('meaningless');

Use:

let lampStatus = off;

It's a really small library which turns some common words into boolean true and false so your code can read and sound much more meaningful.

yes -- true

no -- false

on -- true

off -- false

right -- true

wrong -- false

Example code:


function toggleSwitch() {
  lampStatus = lampStatus === on ? off : on;

  if (lampStatus === on) {
    // Do something
  }
}