nyinaa 0.0.3

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, ...)

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(), ...

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