Attributes
Includes Deno configuration
Repository
Current version released
4 months ago
Versions
- v1.2.0Latest
- v1.1.0
- v1.0.1-jsr
- v1.0.1
- v1.0.0
- v0.3.0-jsr
- v0.2.2
- v0.2.1-jsr
- v0.2.0-jsr
- v0.1.3-jsr
- v0.1.2-jsr
- v0.1.1-jsr
- v0.1.0-jsr
- v0.0.4-jsr
- v0.0.3-jsr
- v0.0.2-jsr.3
- v0.0.2-jsr.2
- v0.0.2-jsr-1
- v0.0.2-jsr
- v0.32.0
- v0.31.0
- v0.30.0
- v0.29.0
- v0.28.1
- v0.28.0
- v0.27.1
- v0.27.0
- v0.26.1
- v0.26.0
- v0.25.0
- v0.24.1
- v0.24.0
- v0.23.2
- v0.23.1
- v0.23.0
- v0.22.1
- v0.22.0
- v0.21.0
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.4
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.1
- v0.16.0
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.1
- v0.1.0
- v0.0.1
deno-fn / somefn
A collection of utility functions for Deno
This project is still under development, and the parameters of the functions are subject to change.
Generic JS Functions (Browser Environment Compatible)
Cryptography & Hashing
- Hash Functions
- SHA1
- SHA256
- SHA512
- HMAC
- SHA256
- SHA512
- RSA Data Signing
- Uint8Array to Hex String Utilities
String Processing
- Text BOM Addition (for legacy Windows software)
- Random String Generation (using Web API
crypto
) - LZ-string Compression/Decompression
- Unicode String Decoding
Calculation & Logic
- Field Calculation (supports arithmetic operations)
- Logic Calculation (supports various comparison operators)
- Precise Decimal Calculation
Data Processing
- UA Parser
- URL Parser
- Environment Variable Parser
- IP Address Utilities
- Date/Time Utilities
- Object/Array Operations
Deno-specific Functions
Git Operations
- Repository Cloning
- Change Detection
- Status Checking
File System
- File Copying with Mapping
- Directory Operations
System
- Command Execution
- SSH Operations
- Computer Info Retrieval
External Dependencies
- CSV: Use Deno standard library https://deno.land/std@0.217.0/csv/mod.ts
- XML: Recommended to use
npm:fast-xml-parser
- Uint8Array to HEX: https://deno.land/std@0.217.0/encoding/hex.ts
Usage Examples
import { hashString } from "@zsqk/somefn/js/hash";
import { fieldCalculate } from "@zsqk/somefn/js/calculate-field";
import { logicCalculate, LogicOperator } from "@zsqk/somefn/js/calculate-logic";
import { getWeekday } from "@zsqk/somefn/js/date";
// Hash calculation example
const hash = await hashString("hello world", "SHA-256");
console.log(hash); // Outputs SHA-256 hash value
// Field calculation example
const data = { price: 100, quantity: 2 };
const total = fieldCalculate(data, "price * quantity".split(" "));
console.log(total); // Output: 200
// Logic calculation example
const logicData = { age: 25, name: "John" };
const result = logicCalculate(logicData, {
condition: "AND",
rules: [
{ field: "age", operator: LogicOperator.greaterThan, value: 18 },
{ field: "name", operator: LogicOperator.equals, value: "John" }
]
});
console.log(result); // Output: true
// Date calculation example
const before = new Date("2024-01-01");
const after = new Date("2024-01-31");
const weekdays = getWeekday(before, after);
console.log(weekdays); // Outputs weekday statistics
License
MIT