nyinaa 0.0.4

A collection of reusable functions & utilities (timers, validators, sanitizers, ranges, logging, ...)


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Nyinaa

A collection of reusable functions & utilities (timers, validators, sanitizers, ranges, logging, ...)

Installation

To install this package from the Dub package repository, you may add nyinaa as dependency in your dub.json file and the package will be downloaded automatically during project build if it's not downloaded already.

{
    "dependencies": {
        "nyinaa": "~>0.0.3"
    }
}

You may also fetch the latest version manually in the command-line:

dub add nyinaa

Example

import nyinaa.timers : setInterval, stopInterval;

import std.stdio : writeln;
import std.datetime : seconds;
import core.thread.osthread : Thread;

void main()
{
	// "tid" of type Tid can be referenced 
	// to stop setInterval()
	auto tid = setInterval(1000.seconds, { writeln("tick"); });
	auto tid2 = setInterval(3000.seconds, { writeln("tock"); });
	Thread.sleep(12.seconds);

	// stop running setInterval()
	stopInterval(tid);
	stopInterval(tid2);

	// OR keep running timers
	// using import core.thread.osthread: thread_joinAll;
    // thread_joinAll();
}

Collections

These are the categories of utilities currently being implemented

  • Sanitizers - for sanitizing data, stripTags(), ...
  • Validators - for user data (e.g. form data) validation, isEmail, isIp, isIpv4, isIpv6, ...
  • Timers - time utility function, setInterval(), ...

Documentation

See the documentation for the various functions and examples on how to use them.

To-do

Any generic validator form validation, etc. is welcomed

Authors:
  • Lawrence Aberba
Dependencies:
none
Versions:
0.0.5 2021-Jan-18
0.0.4 2020-Jul-30
0.0.3 2020-Jul-25
0.0.2 2020-Jul-25
0.0.1 2020-Jul-25
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 18 downloads total

Score:
1.0
Short URL:
nyinaa.dub.pm