Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/simple_utility/mod.full.ts

Simplify processing for Deno.
Latest
import * as simpleUtility from "https://deno.land/x/simple_utility@v2.3.2/mod.full.ts";

Functions

Convert from base64 encoded string to binary.

Convert from binary to base64 encoded string.

Concat multiple sources into single binary.

Decrypt binary. Algorithm is AES-GCM with 128 bits key, 128 bits tag and 96 bits IV. IV is read from head of cipher.

Encrypt binary. Algorithm is AES-GCM with 128 bits key, 128 bits tag and 96 bits IV. IV is prepended to cipher.

Generate exportable public-key pair for ECDH. Curve algorithm is "NIST P-256". Key format is SPKI for public-key and PKCS8 for private-key.

Generate exportable public-key pair for ECDSA. Curve algorithm is "NIST P-256". Key format is SPKI for public-key and PKCS8 for private-key.

Derive hash value from binary. Default is SHA-256.

Generate random binary with any number of bytes.

Create signature using private-key.

Verify signature using public-key.

Convert from CSV string to object array. If parsing failed of cell value use default (def) value. Convert to same type as default value.

Convert from object array to CSV string.

Apply Object.freeze() recursive.

Apply Object.seal() recursive.

Decompress DEFLATE format binary. Default codec is DEFLATE with no header (RFC-1951) and name in WebAPI specification is "deflate-raw".

Compress binary with DEFLATE format. Default codec is DEFLATE with no header (RFC-1951) and name in WebAPI specification is "deflate-raw".

Wait for specified time. Return actual elapsed wait time.

Convert from HTML to DOM.

Find all elements with name attribute.

Get value by id search. .value for <input>, .textContent for <textarea> and .value of .selected for <select> <dataset>.

Get value of .checked in group of radio buttons.

Get value by name search. .value for <input>, .textContent for <textarea> and .value of .selected for <select> <dataset>.

Find all input textarea elements with id attribute and convert them to key-value record.

Extended fetch function that can specify response type directly.

Read JSON file and convert to object. If JSON file does not exist create new file with default value. Argument default value also act as type definition.

Read JSON file and convert to object.

Convert from object to JSON and write to file.

Start logging. Output to console for general and also write to file if path is defined.

Decode binary of "minipack" format.

Concat files with "minipack" format.

Convert from dirty text to specified type. Enabling strict flag will throw exception if parsing failed.

Convert from dirty text to specified type. If parsing failed use default (def) value. Convert to same type as default value.

Run command as subprocess.

Convert from EXCEL workbook to workbook object.

Convert from EXCEL workbook to sheetjs raw workbook object.

Convert from workbook object to EXCEL workbook.

Convert from sheetjs raw workbook object to EXCEL workbook.

Send E-MAIL using SMTP.

Convert from stream to binary.

Convert from binary to stream.

Convert from encoded binary to string.

Convert from string to UTF-8 binary.

Convert half-width string (ex: Japanese Kana) to full-width and full-width alphanumeric symbols to half-width.

Combined textFixWidth() and textPurgeSuperfluous().

Convert from hex string to binary.

Convert from binary to hex string.

Create string with zero padding at beginning of number. Output is 2 digits by default.

Trim head and tail blank, remove CR and consecutive space, tab, LF to single space, tab, LF.

Accurately recognize string that contain character above 0x010000 and array them one by character. Useful for calculate number of characters with string contains emoji.

Convert from UNIXTIME or formatted datetime string to Date. If no args will be current time. Note that in seconds not milliseconds.

Convert from Date or formatted datetime string to UNIXTIME. If no args will be current time. Note that in seconds not milliseconds.

Serialize from Date or UNIXTIME or formatted datetime string to "yyyyMMddhhmmss". If no args will be current time.

Register TaskAction and return reusable task execution context. Worker instance is created and destroyed each time they run TaskContext. import can only use "syntax", not "declaration".

Convert from ZIP archive to named binary.

Convert from named binary to ZIP archive.

Interfaces

Simple name and body pair.

Added query which allows you to specify query string to RequestInit.

E-MAIL message.

Workbook Object

Worksheet Cell Object

Worksheet Object

Type Aliases

Make interface acceptable in Record type argument.

Content of processing run by worker thread.

Run registered TaskAction in worker thread.