Skip to main content

easyutil

A collection of useful utilities to make development with Deno even easier!

Usage

import easy from "https://deno.land/x/easyutil@0.2.0/mod.ts";

Functions

Trim

Inspiration and code bits borrowed from Jason Larke’s Stack Overflow answer here: https://stackoverflow.com/a/55292366/508558

const t = easy.trim(str, '/');
const lt = easy.ltrim(str, '/');
const rt = easy.rtrim(str, '/');
const mt = easy.mtrim(str, ['/', '\\']);
const lmt = easy.lmtrim(str, ['/', '\\']);
const rmt = easy.rmtrim(str, ['/', '\\']);
const t = easy.wtrim(str, 'word');
const lwt = easy.lwtrim(str, 'word');
const rwt = easy.rwtrim(str, 'word');

Sleep

easy.sleep(1000);

Tests

Run tests with:

$ deno test tests/