mybool
v1.0.0
Published
This module is for making your own booleans, with different true and false values.
Downloads
14
Maintainers
Readme
What is this?
This module is for making your own booleans, with different true and false values.
For example I want to make my boolean like this: true value: "exists" false value: "dexists"
So I can make that with this module!
Usage
var mybool = require('mybool');
var options = {
true: "exists",
false: "dexists"
}
var booly = new mybool(options);
booly.set("exists");
console.log(booly.state);
//Output: exists
//You can not set it to anything else
booly.set("hi"); //ERROR
//Reseting
booly.reset(); //will reset it to false value
options = {
true: "hi",
false: "bye"
}
booly.reset(options); //will reset it's options.
Owner and License
kakahan (I) own it.