Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.16 KB

File metadata and controls

50 lines (32 loc) · 1.16 KB

Fluffy · npm type definitions npm CircleCI Downloads

Misc helpful functions to make your life better.

Installation

Using npm:

$ npm i -g npm
$ npm i @keisei/fluffy

Note: add --save if you are using npm < 5.0.0

using yarn:

$ yarn add @keisei/fluffy

Examples

We will have several examples soon. Here is the first one you get started.

import fluffy from '@keisei/fluffy';

function addOne(num = fluffy.require()) {
  return num + 1;
}

// Also you can use
import { required } from '@keisei/fluffy';

function addOne(num = required()) {
  return num + 1;
}

addOne(); // Uncaught TypeError

addOne(1); // Got 2

// You can pass error messages to give people a detailed description.
require('Please provide a valid parameter');

License

Fluffy is MIT licensed.