booleans.io
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

boolean-api

A nodeJS API for https://booleans.io/ with ES6 and promise support!

Usage

import { createBoolean } from 'booleans.io';

let mybool = createBoolean(false);

mybool.get().then(alert);

Advanced usage

import { Boolean } from 'booleans.io';
import $ from 'jquery';

let featureflag = Boolean('50741f52-9b64-4ee1-a2d6-67ee1a60807c');

mybool.if(() => {
    $('#epic-feature').text('YEAAHHHHH');
}, () => {
    // :(
    $('#epic-feature').remove();
});

Typescript Support

/// <reference path="../node_modules/booleans.io/index.d.ts" />
import createBoolean = require('booleans.io');
var myBool: Boolean = createBoolean(true);

myBool.set(false);

API

  • Get()
  • Set(bool)
  • Toggle()
  • Destroy()
  • If(callback, callback)

Readme

Keywords

Package Sidebar

Install

npm i booleans.io

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • lexicality