A collection of standard library modules for Deno and TypeScript, providing robust and reusable utilities for common programming tasks.
This repository is organized into several workspaces, each focusing on a specific domain:
Workspace | Description |
---|---|
daterange |
Utilities for creating and managing date ranges. |
datetime |
Tools for working with dates and times. |
duration |
Functions for handling time durations and formatting. |
fs |
A library for advanced filesystem operations. |
response |
Helpers for creating consistent and safe API responses. |
string |
A collection of advanced string manipulation utilities. |
type |
A set of type guards and utilities for runtime type safety. |
You can add a package to your project using the deno add
command, which will add the package to your deno.json
file.
It is recommended to pin to a specific version for stability.
deno add @epdoc/type
Note: Please replace 0.1.0
with the desired version tag.
Then, you can import and use the modules in your code.
// Example: Using the isString type guard from the 'type' module
import { isString } from '@epdoc/type';
const value: unknown = 'hello world';
if (isString(value)) {
console.log(value.toUpperCase()); // HELLO WORLD
}
Alternatively, you can import a module directly from its URL without adding it to your deno.json
.
// Example: Using the isString type guard from the 'type' module
import { isString } from 'https://deno.land/x/epdoc_std@v0.1.0/type/mod.ts';
const value: unknown = 'hello world';
if (isString(value)) {
console.log(value.toUpperCase()); // HELLO WORLD
}
Note: Please replace v0.1.0
with the desired version tag.
To run all tests for all workspaces, execute the following command from the root of the repository:
deno test
To run tests for a specific workspace, navigate to its directory:
cd type
deno task test
This project uses deno fmt
for code formatting.
deno fmt
This project is licensed under the terms of the MIT License.